Dynamic 32-64 bit loading [message #824633] |
Mon, 19 March 2012 18:22  |
Eclipse User |
|
|
|
I'd like to be create an SWT jar, let's say for Windows to keep it simple, that would dynamically load the 32 bit native SWT dlls if the JVM is 32 bit and the 64 bit SWT dlls if the JVM is 64 bit.
It seems like someone must have done this before, but it's not clear to me how without patching SWT and doing it the hard way.
Any advice would be much appreciated. Thanks!
-Adam
|
|
|
|
|
|
|
Re: Dynamic 32-64 bit loading [message #840927 is a reply to message #824633] |
Tue, 10 April 2012 13:29  |
Eclipse User |
|
|
|
See:
http://stackoverflow.com/questions/2706222/create-cross-platform-java-swt-application/5784073#5784073
I've done something similar. I have an Ant build script that packages
all the SWT jars into a single jar along with the application code - in
a folder structure much as Tom suggests.
The main method for the app then creates a URL class loader with an
appropriate URL to load the correct SWT jar for the platform its running on.
You bulk up the size of your jar, but you then know you have a universal
runnable jar.
Right now I only package for Win32 & Win64 as that's my customer base.
Its simple enough to add Mac, Linux, etc.
On 3/19/12 6:22 PM, Adam Fisk wrote:
> I'd like to be create an SWT jar, let's say for Windows to keep it
> simple, that would dynamically load the 32 bit native SWT dlls if the
> JVM is 32 bit and the 64 bit SWT dlls if the JVM is 64 bit.
>
> It seems like someone must have done this before, but it's not clear to
> me how without patching SWT and doing it the hard way.
>
> Any advice would be much appreciated. Thanks!
>
> -Adam
|
|
|
Powered by
FUDForum. Page generated in 0.04843 seconds