Runing swt apps by double-click on jar-file [message #437012] |
Fri, 28 May 2004 08:06 |
Eclipse User |
|
|
|
Originally posted by: john.rmts.donpac.ru
Hi,
I wrote the next manifest for my jar:
Manifest-Version: 1.0
Main-Class: jtest.ui.JTestApp
Class-Path: swt.jar jface.jar runtime.jar
So, if I place my jar in directory with swt.jar, jface.jar, runtime.jar
and swt-win32-2135.dll, I can run my jar by double-click on jar-file in
Windows.
But I have a next directory tree in my distribution:
myapp
win32
swt.jar
swt-win32-2135.dll
linux-gtk2
swt.jar
libswt-gtk-2135.so
libswt-pi-gtk-2135.so
linux-motif
swt.jar
libswt-motif-2135.so
boot.jar
jface.jar
runtime.jar
myapp.jar
I can rewrite manifest:
Manifest-Version: 1.0
Main-Class: jtest.ui.JTestApp
Class-Path: win32/swt.jar jface.jar runtime.jar
But in this case I need to place swt-win32-2135.dll in the same
directory as myapp.jar or run myapp.jar with java
-Djava.library.path=win32 myapp.jar
How can I say to myapp.jar to search swt-win32-2135.dll in win32 directory?
Can I execute some code in my application to set java.library.path=win32
before swt initializing?
|
|
|
|
Re: Runing swt apps by double-click on jar-file [message #437099 is a reply to message #437093] |
Fri, 28 May 2004 17:10 |
Eclipse User |
|
|
|
Originally posted by: john.rmts.donpac.ru
David Thomson ?????:
> This may help:
>
> String fsep = System.getProperty("file.separator");
> String user = System.getProperty("user.dir");
> String dir = user+fsep+"win32";
> System.setProperty("java.library.path", "C:\\Program Files\\Suprasphere"
> + dir);
This code must be executed before swt initialization, so I can't write
it in constructor of ApplicationWindow child. Where can I write it?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03419 seconds