|
|
|
|
|
|
Re: How to build Windows 7/64-bit SWT apps [message #774318 is a reply to message #769300] |
Tue, 03 January 2012 17:27 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
The bitness of the jvm and of the swt being used must match because the
jvm will refuse to load swt's native libraries otherwise. SWT verifies
this the first time that a library load is requested so that if this is
not satisfied then a meaningful error message is output (the one you're
seeing) rather than the more generic java.lang.UnsatisfiedLinkError that
occurs otherwise.
So if you want to have a single download that can be run with either a
32- or 64-bit jvm then you need to ship both 32- and 64-bit swt jars,
and determine at runtime which of them to load. Java's "os.arch" system
property can be used to determine this, as its value reflects the
bitness of the jvm, not of the OS (so it will answer something like
"i386" or "i686" when using a 32-bit jre on a 64-bit OS, which is what
you're interested in).
Grant
On 12/21/2011 1:55 PM, Bill wrote:
> Thanks everyone who has tried to help. Below I will explain the many
> failed attempts to fix this and ask again for any help.
>
> For anyone else having this problem, the following links may be helpful:
>
> http://www.eclipse.org/swt/eclipse.php
> http://stackoverflow.com/questions/2921193/swt-on-windows-64-bit
>
> Situation:
> 1. Trying to create stand alone SWT/JFace app.
> 2. Totally don't care if it's 32, 64 or 179.3 bits.
> 3. In Windows/Preferences/Java/Installed JREs, have tried selecting both
> 32 bit and 64 bit JRE's. Have downloaded and installed others.
> 4. Out of desperation, may go and install a different version of Eclipse
> (and probably break countless other projects).
> 5. We always get the message:
> java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on
> 32-bit JVM
>
>
> I've heard a few things now, so maybe these questions will shed light:
>
> 1. When launching an app from Eclipse, simply editing the settings in
> "Window/Prefs/Java/Installed JREs" should allow us to launch an app with
> either a 32-bit JRE or a 64-bit JRE regardless of what version of
> Eclipse I am running. True?
>
> 2. Some say you need to have both the 32-bit and 64-bit versions of the
> jar file. What's with that? Given that SWT is a wrapper around native
> controls, why would anyone want to complicate things further? I can't
> believe this.
>
|
|
|
|
|
Re: How to build Windows 7/64-bit SWT apps [message #777492 is a reply to message #777458] |
Tue, 10 January 2012 15:45 |
H. M. Messages: 4 Registered: January 2012 |
Junior Member |
|
|
I tried it already, but no effect and I did not use the Linux SWT.
I already uninstalled all java versions and reinstalled them but no chance.
On another Win7 Pc with JRE7_U2 running it works all fine.
It might be the fact that the swt.dll files cannot be copied temporarily to the \..\AppData\Local\Temp directory (like it is on another machine). Every attemp to run the example or another SWT app it creates an empty swtlib-64 folder. I also made a test with another new created user account, but the error still occurs... It must be something with the system configuration, but I cannot locate the error at the moment.
[Updated on: Tue, 10 January 2012 15:45] Report message to a moderator
|
|
|
|
|
Re: How to build Windows 7/64-bit SWT apps [message #885695 is a reply to message #768790] |
Wed, 13 June 2012 12:55 |
Tom Silverman Messages: 1 Registered: June 2012 |
Junior Member |
|
|
I was teaching 'Eclipse Plugins' the other day to a class of developers who were all working on Windows 7 64 bit OS's. Some installed the course provided Helios RCP 32 bits IDE and some were working with their usual Indigo JavaEE IDE 64 bits.
We were exercising stand alone SWT applications. The only solution that actually worked for those who were using the Helios 32 bits to avoid the 'Could not load SWT library' problem was to install a 32 bits JDK. They had to reconfigure the IDE installed JRE (through the IDE preferences) to actually point to the 32 bits JDK. We did not try the -d32 JVM argument yet on a 64 bits version JVM.
BTW: The %JAVA_HOME% environment variable is, in my opinion, totally irrelevant in newer versions of Windows in this context. It seems Windows obtains the information from the registry and not from the environment variable and when you issue the 'java -version' command in a console you will always get the version that was installed with Windows installer regardless of the JAVA_HOME environment variable.
[Updated on: Wed, 13 June 2012 13:00] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04597 seconds