Skip to main content

JVM crashes with Tray Icon enabled

8 replies [Last post]
alexz75
Offline
Joined: 2004-06-14

I use TrayIcon API on Windows And Linux platforms with JRE 1.5.0, jdic 0.8.6 for windows, and jdic 0.8.6.1 for linux.
I built folder with all need libraries within:
- application folder
|
|-- lib
|
+-- linux (here jar and linux native libs)
|
+-- windows (here jar and windows native libs)

To select required version i have two startup files with different classpath and java.library.path
And....
It work nice with Windows (98 and XP), in linux it result to JVM crashes suddenly and/or tray icon fallout.

Regards,
Alexander Slepoy
http://hylafront.imacrovision.com

Message was edited by: alexz75

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bino_george
Offline
Joined: 2003-06-16

Hi,

> And....
> It work nice with Windows (98 and XP), in linux it
> result to JVM crashes suddenly and/or tray icon
> fallout.

Did you set the JAVA_HOME env variable to point to
your Java ? This is required I beleive, since the Unix
code uses this variable to locate the AWT native
libraries. Atleast it did at some point, I am not
positive if it still does. Thanks,

Regards,
Bino.

georgez
Offline
Joined: 2003-08-19

Yes, JAVA_HOME needs to be set to use the Tray Icon API with all the current releases (0.8.6 or before). But it's fixed by Armin:
https://jdic.dev.java.net/issues/show_bug.cgi?id=139

will be included in the next release.

-George.

alexz75
Offline
Joined: 2004-06-14

But i do it... Possible i have some mistake???
here my startup file:

#!/bin/sh
# startup for linux
#
#
export PATH="$PATH:./lib/linux"
export JAVA_HOME="/usr/java/jre1.5.0"
$JAVA_HOME/bin/java -Djava.library.path=./lib/linux -classpath hylafront.jar:./lib/linux/jdic.jar org.xander.hylafront.hylaFrontFrame

alexz75
Offline
Joined: 2004-06-14

I have the same trouble under Mandrake 10.1
Or JVM Crash, or unvisible tray icon...

JAVA_HOME was set (see below)

Any suggestions??? May be trouble with icon size?
(On Windows all ok).

armin_chen
Offline
Joined: 2004-09-29

Hi Alex,

Do you enable the "Notification Area" ?

On Linux, if you do not see tray icons, the notification area is probably disabled. You can enable it by right-clicking the GNOME panel and selecting Add to Panel -> Utility -> Notification Area.

Regards
-Armin

alexz75
Offline
Joined: 2004-06-14

[b]armin_chen[/b],

I tested on KDE and GNOME (of couse with enabled notfication area), on Mandrake 10.1. and Fedora Core 3.

In first moment I see tray icon. If I'll try to open/close about box, everything ok, but if I'll open and minimize (to tray) once again... or Icon hidden, or JVM crash. The same code work fine on windows.

Here my function (ti defined at program init):
// part from Main function
if (useTrayAPI){
try{
initTrayIcon(instance.getIconImage());
} catch (java.lang.UnsatisfiedLinkError err){
err.printStackTrace();
ti=null;
}
}
/////
private static void openCloseWindow(){
if (ti!=null){
SystemTray tray = SystemTray.getDefaultSystemTray();
if (hylaFrontFrame.getInstance().isVisible()){
hylaFrontFrame.getInstance().setVisible(false);
tray.addTrayIcon(ti);
} else {
hylaFrontFrame.getInstance().setState(JFrame.NORMAL);
hylaFrontFrame.getInstance().setVisible(true);
hylaFrontFrame.getInstance().requestFocus();
hylaFrontFrame.getInstance().toFront();
tray.removeTrayIcon(ti);
}
}

}

armin_chen
Offline
Joined: 2004-09-29

Hi,

Would you please report a bug to our issue tracker, and provide your test-case to help us to reproduce this problem. We will try to fix it if it's a bug.

Thanks.
Armin

alexz75
Offline
Joined: 2004-06-14

Recently,
Anyway - great project, Thanks!