jruby system tray example

Here’s the “fixed” example from http://my.safaribooksonline.com/9780596155063/accessing_the_system_tray


include Java

import java.awt.TrayIcon
import java.awt.event.MouseListener

if (java.awt.SystemTray::isSupported())

  tray = java.awt.SystemTray::system_tray
  image = java.awt.Toolkit::default_toolkit.get_image("tray.gif")

  popup = java.awt.PopupMenu.new
  exititem = java.awt.MenuItem.new("Exit")
  exititem.addActionListener {java.lang.System::exit(0)}

  oraitem = java.awt.MenuItem.new("Go To ORA")
  oraitem.addActionListener do
    java.awt.Desktop::desktop.browse(java.net.URI.new("http://www.ora.com"))
  end

  popup.add(exititem)
  popup.add(oraitem)
  trayIcon = TrayIcon.new(image, "Tray Demo", popup)
  trayIcon.image_auto_size = true

  trayIcon.addActionListener do |evt|
    trayIcon.displayMessage("Action","Tray Action!",
    TrayIcon::MessageType::WARNING)
  end

  trayIcon.addMouseListener() do |method|
    puts "mouse event #{method.to_s}"
  end

  tray.add(trayIcon)
end

mvn woe

[INFO] Preparing exec:java
[INFO] [enforcer:enforce {execution: enforce-version}]
[INFO] [exec:java {execution: default-cli}]
[INFO] ————————————————————————
[ERROR] BUILD ERROR
[INFO] ————————————————————————
[INFO] An exception occured while executing the Java class. org.familysearch.idismigration.shuttlewriter.MigrationTapeWriter

meant “you are trying to run that class from the wrong directory!”

gcc woe

making all in crypto…
make[1]: Entering directory `/c/dev/ruby/rubyinstaller/sandbox/openssl/crypto’
( echo “#ifndef MK1MF_BUILD”; \
echo ‘ /* auto-generated by crypto/Makefile for crypto/cversion.c */’; \
echo ‘ #define CFLAGS “gcc -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -DDSO_WIN32 -mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0×333 -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM”‘; \
echo ‘ #define PLATFORM “mingw”‘; \
echo ” #define DATE \”`LC_ALL=C LC_TIME=C date`\”"; \
echo ‘#endif’ ) >buildinf.h
gcc -I. -I.. -I../include -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -DDSO_WIN32 -mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0×333 -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -c -o cryptlib.o cryptlib.c
cryptlib.c:121: warning: ‘SSLeay_MSVC5_hack’ defined but not used
C:\DOCUME~1\packrd\LOCALS~1\Temp\cc5aiOLP.s: Assembler messages:
C:\DOCUME~1\packrd\LOCALS~1\Temp\cc5aiOLP.s:428: Error: junk at end of line, first unrecognized character is `,’
C:\DOCUME~1\packrd\LOCALS~1\Temp\cc5aiOLP.s:429: Error: junk at end of line, first unrecognized character is `,’
C:\DOCUME~1\packrd\LOCALS~1\Temp\cc5aiOLP.s:430: Error: junk at end of line, first unrecognized character is `,’
C:\DOCUME~1\packrd\LOCALS~1\Temp\cc5aiOLP.s:431: Error: junk at end of line, first unrecognized character is `,’
C:\DOCUME~1\packrd\LOCALS~1\Temp\cc5aiOLP.s:432: Error: junk at end of line, first unrecognized character is `,’
make[1]: *** [cryptlib.o] Error 1

meant “don’t use TDM GCC 4.4.0 to install openssl 0.9.8k — use perhaps gcc 3.4.5?”

maven woe

[INFO] [csharp] Skipping C# compile because a compile executale was neither found nor provided. The C# bundle will only include the sources.
error: error reading /home/rdp/.m2/repository/org/apache/xbean/xbean-spring/2.7/xbean-spring-2.7.jar; cannot read zip file
1 error
[INFO] ————————————————————————
[ERROR] BUILD ERROR
[INFO] ————————————————————————
[INFO] Problem assembling the enunciate app.

meant “that jar file’s server is currently unavailable–try to get that jar from some other source [a neighbor? a friend?] and drop it in right there over that fake file”