Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Developing 32bit SWT application on 64bit Linux
Developing 32bit SWT application on 64bit Linux [message #1389825] Sat, 28 June 2014 11:48 Go to next message
Setya Mising name is currently offline Setya Mising name
Messages: 486
Registered: July 2009
Senior Member
Hi all,

We're developing small SWT application using Eclipse 3.8.0 64bit on
Linux Mint 64bit.

At first we imported 64bit SWT (swt-4.3.2-gtk-linux-x86_64) and JDK
1.8.0_05 64bit and everything worked fine.

Then we decided that we're going to deploy the app on 32bit client only,
so we switch to 32bit SWT (swt-4.3.2-gtk-linux-x86) and JDK 1.8.0_05
32bit but still developing on the same 64bit Eclipse and Linux box.

When we run the application it threw the following exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not
load SWT library. Reasons:
no swt-pi-gtk-4335 in java.library.path
no swt-pi-gtk in java.library.path
<home>/.swt/lib/linux/x86/libswt-pi-gtk-4335.so: libgtk-x11-2.0.so.0:
cannot open shared object file: No such file or directory
Can't load library: <home>/.swt/lib/linux/x86/libswt-pi-gtk.so

at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.gtk.OS.<clinit>(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at com.modulariti.viewer.AppViewer.main(AppViewer.java:14)

We've checked that <home>/.swt/lib/linux/x86 was always created and the
following files were there:

libswt-gtk-4335.so
libswt-pi-gtk-4335.so

We have search forums and some suggested to move/create link from
/usr/lib/jni/*so to <home>/.swt/lib/linux/x86 but it did not solve the
problem.
We also tried adding VM arguments
-Djava.library.path=<home>/.swt/lib/linux/x86 and did not work either.

Any help would be greatly appreciated.


Regards,

Setya
Re: Developing 32bit SWT application on 64bit Linux [message #1389852 is a reply to message #1389825] Sat, 28 June 2014 12:53 Go to previous messageGo to next message
Tomas R. is currently offline Tomas R.
Messages: 7
Registered: July 2009
Junior Member
Hi, I'm not an expert, but I decided to reply and share my two cents as these forums seem mostly dead, which is a shame.

I too develop for multiple platforms. I write the code on a Mac, while my customers use Windows. To build and debug application on the target platform I start virtual machine right before creating a release, debug my code there so it works well under win32 and build it using maven that is configured to use the right libraries according to the platform it is running on.

So just work with 64bit libraries on your development platform and install a (virtual) machine with your target 32-bit OS, set up a development environment there and configure your build platform (eclipse/maven/gradle...) to produce working builds for either platform. It is not ideal, but it simply works.

I hope that someone else will reply and solve your issue so that you won't need virtual machines, but well, try this first Smile
Tomas

[Updated on: Sat, 28 June 2014 13:01]

Report message to a moderator

Re: Developing 32bit SWT application on 64bit Linux [message #1389923 is a reply to message #1389852] Sat, 28 June 2014 15:40 Go to previous message
Setya Mising name is currently offline Setya Mising name
Messages: 486
Registered: July 2009
Senior Member
On 06/28/2014 07:53 PM, Tom Brblal wrote:
> Hi, I'm not an expert, but I decided to reply and share my two cents as
> these forums seem mostly dead, which is a shame.
>
> I too develop for multiple platforms. I write the code on a Mac, while
> my customers use Windows. To build and debug application on the target
> platform I start virtual machine right before creating a release, debug
> my code there so it works well under win32 and build it using maven that
> is configured to use the right libraries according to the platform it is
> running on. So in your case I would just install a virtual machine with
> your target 32bit OS, set up a development environment there and
> configure your build platform (eclipse/maven/gradle...) to produce
> working builds. It is not ideal, but it simply works.
>
> I hope that someone else will reply and solve your issue so that you
> won't need virtual machines, but well, try this first :)
> Tomas

Hi,

I've solved the problem, it's all about dependency:

Below is what I did on the Linux box for those who have the same problem:

sudo apt-get install libgtk2.0-0:i386
sudo apt-get install libxtst6:i386
sudo apt-get install gtk2-engines-pixbuf:i386
sudo apt-get install gtk2-engines-murrine:i386


Thanks & Regards,

Setya
Previous Topic:Question: Correct implementation of complex component layout
Next Topic:Buttons in setTabList do no accept focus
Goto Forum:
  


Current Time: Fri Oct 31 20:10:26 GMT 2014

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

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