Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Runing swt apps by double-click on jar-file
Runing swt apps by double-click on jar-file [message #437012] Fri, 28 May 2004 08:06 Go to next message
Eclipse UserFriend
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 #437093 is a reply to message #437012] Fri, 28 May 2004 15:17 Go to previous messageGo to next message
David Thomson is currently offline David ThomsonFriend
Messages: 65
Registered: July 2009
Member
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);
Re: Runing swt apps by double-click on jar-file [message #437099 is a reply to message #437093] Fri, 28 May 2004 17:10 Go to previous messageGo to next message
Eclipse UserFriend
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?
Re: Runing swt apps by double-click on jar-file [message #437108 is a reply to message #437099] Fri, 28 May 2004 23:10 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
You could write it as a static initializer in your main class. That'll
cause it to run before anything else.

Daniel

Eugene Prokopiev wrote:

> 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?
>
Re: Runing swt apps by double-click on jar-file [message #437174 is a reply to message #437108] Mon, 31 May 2004 06:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: john.rmts.donpac.ru

Daniel Spiewak ?????:

> You could write it as a static initializer in your main class. That'll
> cause it to run before anything else.

It is not work for swt :(
Re: Runing swt apps by double-click on jar-file [message #437193 is a reply to message #437174] Mon, 31 May 2004 18:36 Go to previous message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
Hmm, doesn't SWT initialization occur when Display is instananciated?

Daniel

Eugene Prokopiev wrote:

> Daniel Spiewak ?????:
>
>> You could write it as a static initializer in your main class.
>> That'll cause it to run before anything else.
>
>
> It is not work for swt :(
>
Previous Topic:Enter key down event problem
Next Topic:How Can I Implements This?
Goto Forum:
  


Current Time: Fri Apr 26 13:29:18 GMT 2024

Powered by FUDForum. Page generated in 0.03419 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top