Skip to main content

is way to load tray.dll without using vm parameters?

6 replies [Last post]
rfwalker
Offline
Joined: 2004-09-15
Points: 0

hi all, I am loading a application via Java Web Start
and don't think it supports vm parameters other than
memory and one other I think. But the jdic systray
expects

-Djava.library.path=c:\xyz

where c:\xyz is where tray.dll is

I guess I could load the app, ftp the tray.dll
to the client and then if I had a way to specify
where the dll is after app is started, point to it
and it'll load then.

also, on a not so important note,
I don't see the src anywhere, is this something
thats not available.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rfwalker
Offline
Joined: 2004-09-15
Points: 0

the reason I ask for the src code is becasie I would like to contribute and have the dll location be loaded
during runtime as well as via vm parameter

maybe its possible to load vm parameters programatically?

willdenniss
Offline
Joined: 2003-08-14
Points: 0

print the "java.library.path" property (System.getProperty) and you should see a list of directories. The dll can go in any of those directories so you don't have to specify it at runtime. These directories differ from platform to platform.

Will.

rfwalker
Offline
Joined: 2004-09-15
Points: 0

thanks will, but the thing is
its being downloaded via java web start, which puts
jars in its own cache and then mangles the name,
like tray.jar got renamed RMtray.jar

I think I have to use
java web start's

and put the dll at the root level in this system_try_dll.jar

and do a System.loadLibrary("tray");
on a windows pc this tries to load tray.dll

Message was edited by: rfwalker

rfwalker
Offline
Joined: 2004-09-15
Points: 0

ok, my code did not work above, i figured if I did a

System.loadLibrary("tray");

and tray.dll was in a loaded jar at its root dir, then it would work, but its looking for the system property
java.library.path, even though i imagine that the jdic does a System.loadLibrary("tray"); in its internal code, but I do not have the src so not sure about that

i would like to look modify code so its more flexiable, or just solve this dilema :-)

Message was edited by: rfwalker

rfwalker
Offline
Joined: 2004-09-15
Points: 0

ok, i am getting closer, i found the src and in

org.jdesktop.jdic.tray.internal.impl.WinSystemTrayService

there is a

System.loadLibrary("tray");

now java web start claims to load a dll you must wrap
it in a jar, put the jar in the .jnlp resources tag
and under that add a nativelib tag with

this is from JWS dev guide

A nativelib element specifies a JAR file that contains native libraries. For example:

The JNLP Client must ensure that each file entry in the root directory of the JAR file (i.e., /) can be loaded into the running process using the System.loadLibrary method. Each entry must contain a platform-dependent shared library with the correct naming convention, e.g., *.dll on Windows, or lib*.so on Solaris/Linux. The application is responsible for doing the actual call to System.loadLibrary.
===================================================

now the jdic WinSystemTrayService does this
but i get a UnsatisfiedLinkError exception.

uuuuugggg

Message was edited by: rfwalker

rfwalker
Offline
Joined: 2004-09-15
Points: 0

ok, fnally got it, works like a champ,
don't have to pass java.library.path
with -D, if using JWS,
use



where I put tray.dll in system_tray_dll.jar's
root dir