Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem running desktop application from the command line.

807569Sep 25 2006 — edited Sep 25 2006
Hello everyone, I'm new to the forums here - I'm a student at Southampton University Computer Science department, and I'm having some trouble with an application I'm writing.

I have used Eclipse to write the program, which is a System Tray application which shows an icon indicating the status of the net connection (a program born of a summer on a dodgy broadband connection).

The program consists of 3 classes of my own, and depends on a portion of the (https://jdic.dev.java.net/) project, specifically jdic.jar, for the API to put an icon in the windows system tray.

With jdic.jar added to the build path in my Eclipse project, the program works perfectly, but I want to run it as a standalone application from the command line.

After fixing my own classpath, I have been able to compile the project, but every time I try and run it, I get the following error:


Exception in thread "main" java.lang.UnsatisfiedLinkError: no tray in java.libra
ry.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.jdesktop.jdic.tray.internal.impl.DisplayThread.<clinit>(Unknown S
ource)
at org.jdesktop.jdic.tray.internal.impl.WinSystemTrayService.<clinit>(Un
known Source)
at org.jdesktop.jdic.tray.internal.impl.ServiceManagerStub.getService(Un
known Source)
at org.jdesktop.jdic.tray.internal.ServiceManager.getService(Unknown Sou
rce)
at org.jdesktop.jdic.tray.SystemTray.<clinit>(Unknown Source)
at NetStat.makeTrayIcon(NetStat.java:93)
at NetStat.<init>(NetStat.java:20)
at NetStat.main(NetStat.java:124)
Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: removeIcon
at org.jdesktop.jdic.tray.internal.impl.WinTrayIconService.removeIcon(Na
tive Method)
at org.jdesktop.jdic.tray.internal.impl.WinTrayIconService.removeAllIcon
s(Unknown Source)
at org.jdesktop.jdic.tray.internal.impl.WinTrayIconService$1.run(Unknown
Source)

The comand I'm using to run the code is:

E:\My Documents\Degree\Computer Science\Projects\NetStat\NetStat>java -classpath ./jdic.jar;./ NetStat

where NetStat is the main class of the project.

Any help anyone could give me would be greatly appreciated, as I've always found using the command line for running more complicated java projects tricky.

If anyone wants more details of my project, or needs to see my code, just ask.

Many thanks!

PS: If anyone can give me tips as to how to run java programs under windows without being left with the dos-shell window left visible, that would also be fantastic.

Cheers all,

ah502

Message was edited by:
ah502
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2006
Added on Sep 25 2006
2 comments
128 views