JDIC cannot open libawt.so

I was able to compile jdic-0.9.1 on my 64bit linux box and I'm trying to run this code:

...

JPopupMenu menu =new JPopupMenu("Tray Icon Menu");

menu.add(new JMenuItem("Test Item"));

ImageIcon icon =new ImageIcon("tray.png");

TrayIcon ti =new TrayIcon(icon,"JDIC Tray Icon API Test", menu);

SystemTray tray = SystemTray.getDefaultSystemTray();

tray.addTrayIcon(ti);

...

The code runs fine until i try to use a jdic class like TrayIcon or SystemTray... then it dies with the following error:

reflect - bad awtHandle.

/opt/sun-jdk-1.5.0.10/jre/jre/lib/i386/libawt.so: cannot open shared object file:

No such file or directory

The jre/jre isn't a typo, nor does the path exist on my system. This is also a 64bit jdk (1.5.0.10) so the i386 path doesn't exist either. The file libawt.so is actually in /opt/sun-jdk-1.5.0.10/jre/lib/amd64.

I should mention that I also have blackdown-jdk-1.4.2 .03 and sun-jdk-1.6.0 installed. I tried removing them both but my program still fails. I've also tried setting LD_LIBRARY_PATH and LD_PRELOAD; both were unsucessful.

I really need to get this working because upgrading to java 6 (for this particular project) isn't an option for me.

[1508 byte] By [astewarta] at [2007-11-26 14:18:58]
# 1

It would seem that the problem was in the LIBARCH definition in Tray.c. In the code for 0.9.1 there is no check for __x86_64__ and the current check for __linux__ simply sets the LIBARCH to i386. The method GnomeSystemTrayService.initNative uses LIBARCH to build the path to libawt.so so the library isn't found on my amd64 machine.

The arch check has been fixed, as far as I can tell, in the 20061102 sources. I'm trying to compile that codebase now but I think I need to fix some problem with a (missing) javaws.jar.

astewarta at 2007-7-8 2:09:49 > top of Java-index,Desktop,Developing for the Desktop...