Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Building a standalone SWT application
Building a standalone SWT application [message #676589] Sun, 05 June 2011 14:28 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: June 2011
Junior Member
Hi, I'm trying to export my SWT application to a runnable JAR file. So I select run configuration which contains main method and export. When I try to lauch my application from JAR file I receive following message:

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
	at agentcrm.authentication.controllers.AuthenticationController.requestLogin(AuthenticationController.java:269)
	at MainClass.main(MainClass.java:13)
	... 5 more


JAR file contains SWT JAR file and the application runs when launched in Eclipse. I'm using Debian GNU/Linux on an AMD64 and Eclipse is for that architecture. I've found similar problems on forums and tried solutions but they don't work for me.

How can I solve the problem?
Re: Building a standalone SWT application [message #676755 is a reply to message #676589] Mon, 06 June 2011 12:35 Go to previous messageGo to next message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member

--> Caused by: java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM

Hi,
Your application has 32bit SWT libraries instead of 64 bit ones. You can check the contents of the jar to see if it has 32 bit or 64 bit libraries. Make sure that the application is exported with the 64bit SWT libraries to run on 64 bit JVM.



Lakshmi P Shanmugam
Re: Building a standalone SWT application [message #676762 is a reply to message #676755] Mon, 06 June 2011 12:49 Go to previous message
No real name is currently offline No real nameFriend
Messages: 2
Registered: June 2011
Junior Member
Thank you. I've found the problem. I'm working on my project in a team using SVN so there were two versions of swt.jar; one for GNU/Linux 64-bit and the other for Windows 32-bit. Removing the second one the runnable JAR file works.
Previous Topic:SWT ExpandItem widget layout/size problem
Next Topic:Disabled menu item icons missing with Windows Classic theme
Goto Forum:
  


Current Time: Wed Apr 24 20:12:19 GMT 2024

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

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

Back to the top