[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Deploying SWT Application and swt-pi-gtk-3236

Mark Dexter wrote:
Reginald Johnson wrote:
Hello,
I have an SWT app that works great when run using the run command in Eclipse on Ubuntu Gusty Gibbon with the java -version command returning the following:
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)


Unfortunately, I can't create a working jar out of it to save my life. Basically, I have a working program that is trapped in Eclipse. After creating my jar (using the Eclipse "Export" to jar technique as well as the Java javac method with the command jar cmf manifest1.txt SunMouseDatabase1.jar MouseDatabaseApp.class ./lib/* ) and attempting to run it with the following command:

java -jar SunMouseDatabase1.jar
I get this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3236 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:126)
at MouseDatabaseApp.main(MouseDatabaseApp.java:346)


After poking around my system I was able to find a file called libswt-pi-gtk-3236.so, but I'm not familiar with the ".so" file type. I've put that file in my lib directory and pointed to it in the Class-Path of my Manifest file, but I get the same error whether that is in there or not.

the Manifest.mf file in the jar is as follows:

Manifest-Version: 1.0

Class-Path: lib/derby.jar lib/iText-2.0.8.jar lib/jcommon-1.0.12.jar lib/jfreechart-1.0.9-experimental.jar lib/jfreechart-1.0.9-swt.jar lib/opencsv-1.9.jar lib/swtgraphics2d.jar lib/org.eclipse.swt.gtk.linux.x86_3.2.2.v3236.jar lib/org.eclipse.swt_3.2.2.v3236b lib/libswt-pi-gtk-3236.so
Created-By: 1.6.0_03 (Sun Microsystems Inc.)
Main-Class: MouseDatabaseApp


The Class-Path line is all on one line with no line breaks. I've been working and googling this problem over the past two days with no luck, and would appreciate any help. Thanks.

Hi Reginald. I think the .so is a Linux executable (equivalent to a .DLL file in Windows). I believe that the Class-Path line in the manifest file only applies to the .JAR files, not to the .so files. I think the .so file needs to be in the Linux execution path. In Windows, you can put the SWT .DLL files in the same directory as the .JAR file you are executing (or in the execution path, like Windows\system32), but I don't know if having it in the same directory works in Linux. But if the .so file is on your execution path, I think it should work.

On the SWT FAQ, there is a question "What do I need to run SWT on Linux/GTK? (http://www.eclipse.org/swt/faq.php#gtkstartup)

It would seem to imply that the platform-specific binaries for SWT (i.e., the .so files) are included in the Linux packages. I looked for step-by-step instructions for deploying SWT on Linux and couldn't find any, but I think you are very close.

Hope this helps. Mark
Hello again. It looks like, from the version information above, that you're using Eclipse 3.2. Is this correct? It appears that this process got significantly easier with Eclipse 3.3. Now I think you just need the SWT.JAR for your Linux platform, which you can download from Eclipse.org/downloads/eclipse/downloads. Select 3.3.2 and scroll to the bottom where it says SWT Binary and Source. Download the .zip file for your Linux platform, and use the SWT.JAR file that is included with your zip. Include that on your Class-Path in the manifest, and I THINK it should work. The .so files are included in the SWT.JAR file. Hope this helps. Mark