Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Building Swt 64 bit
Building Swt 64 bit [message #534468] Wed, 19 May 2010 09:54 Go to next message
OneGoodTurn  is currently offline OneGoodTurn Friend
Messages: 3
Registered: May 2010
Junior Member
Hi everyone,

<< Originally I posted this in 'Newcomers' but was advised to repost here >>

I've spent a few days now trying to figure out how to build 64 bit SWT for use in an Eclipse Java project I'm working on. There are various resources in the FAQs that seem to be almost what I need, but not quite up to date:

I extracted the sources from CVS as per these instructions...
http://www.eclipse.org/swt/cvs.php

I found build instructions here
http://www.eclipse.org/swt/faq.php#gtk64

and here
http:// www.nbinteractive.com/Free_Resources/internet_tech_blog?arti cle_id=302

But they are both not quite up to date, so I'm trying to guess my way through the recent build scripts without - I think -much success. Here's what I'm doing...

1. Rename .classpath_gtk in org.eclipse.swt to .classpath
2. In org.eclipse.swt.gtk.linux.x86_64, run build.html as Ant Build with target 'build.jars', which gives this output -

Buildfile: /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/build.x ml
properties:
init:
build.jars:
properties:
init:
@dot:
[mkdir] Created dir: /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/temp.fo lder/@dot.bin
copy.gtk.src:
[copy] Copying 684 files to /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/temp.fo lder/@dot.src
copy.translationfiles:
is64:
[echo] Is64=true
replace64:
[echo] Converting java files to 64 bit
[javac] Compiling 582 source files to /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/temp.fo lder/@dot.bin
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[copy] Copying 3 files to /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/temp.fo lder/@dot.bin
[mkdir] Created dir: /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/@dot
[copy] Copying 814 files to /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/@dot
[jar] Building jar: /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/swt.jar
BUILD SUCCESSFUL
Total time: 6 seconds

So no replace.32.to.64 build target exists, but this seems to have built the 64 bit version of SWT as intended.

3. Refresh org.eclipse.swt
4. FAQs say run the Ant build script again, with 'buildNatives' as the target. Again, this doesn't exist, so I've gone for 'buildSources'.

Buildfile: /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/build.x ml
properties:
init:
build.sources:
properties:
init:
src.zip:
copy.gtk.src:
[delete] Deleting directory /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/temp.fo lder/@dot.src
[copy] Copying 684 files to /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/temp.fo lder/@dot.src
copy.translationfiles:
is64:
[echo] Is64=true
replace64:
[echo] Converting java files to 64 bit
[zip] Building zip: /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/src.zip
[delete] Deleting directory /home/mja/workspace/org.eclipse.swt.gtk.linux.x86_64/temp.fo lder/@dot.src
BUILD SUCCESSFUL
Total time: 2 seconds

All still looking good.

5. Refresh the gtk_linux_x86_64 project to pick up new sources.
6. And we are allegedly complete. However, when I attempt to build and run my 'HelloJava' application, I still have the error

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:19 7)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:17 4)
at org.eclipse.swt.internal.C.<clinit>(C.java:21)
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:132)
at HelloWorld.main(HelloWorld.java:12)


I'm clearly missing something, but I can't see what. I'm an experienced Linux dev, but on RT Linux for embedded platforms. I don't normally get involved in Gui work (on Linux).

My Eclipse is
Version: 3.5.2
Build id: M20100211-1343

The x86_64 is 3.647

I'm running Ubuntu Lucid Lynx.

I can't quite see what's going wrong here; either I'm not building the correct targets, or I'm building them but my linkage in the 'HelloJava' for 64 bit SWT is not quite correct,

Any help would be greatly appreciated everyone Smile
Re: Building Swt 64 bit [message #534496 is a reply to message #534468] Wed, 19 May 2010 11:14 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Sorry i dont have solution but i have a query...

Why not download an eclipse for 64 bit linux and start developement directly???

I mean it will contain all the required librarys(SWT and all others required for RCP App).

http://www.eclipse.org/downloads/download.php?file=/technolo gy/epp/downloads/release/galileo/SR2/eclipse-rcp-galileo-SR2 -linux-gtk-x86_64.tar.gz


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay

[Updated on: Wed, 19 May 2010 11:20]

Report message to a moderator

icon14.gif  Re: Building Swt 64 bit [message #535077 is a reply to message #534496] Fri, 21 May 2010 08:53 Go to previous messageGo to next message
OneGoodTurn  is currently offline OneGoodTurn Friend
Messages: 3
Registered: May 2010
Junior Member
Okay, so I found the 64 bit archived file for Swt here after some more poking around.

http:// download.eclipse.org/eclipse/downloads/drops/R-3.5.1-2009091 70800/index.php#SWT

Which I was able to download and Import into my Java application, which now links against the correct 64 bit version.

The solution was indeed straightforward, but answers are only easy when you have them.

Thanks to Vijay for the response, which at least pointed me at the archive server as a possible solution.

In case it's not obvious, I've posted his response with the link I used in case anyone else has the same problem.
Re: Building Swt 64 bit [message #535193 is a reply to message #534468] Fri, 21 May 2010 14:06 Go to previous message
Ryan Levering is currently offline Ryan LeveringFriend
Messages: 3
Registered: May 2010
Junior Member
Well, if you look at your step 4, it's not doing anything at all but building a source archive. So that's not right at all. I think if you take your swt.jar and shove the native libraries (which you don't need to rebuild, just take from the x64 branch) into the jar, you should be fine. That's generally what I do when I need to rebuild. I'm sure there's a more elegant solution, but that would work.
Previous Topic:How to re-layout controls in a view
Next Topic:SWT OLE and PowerPoint- Control Order Matters?
Goto Forum:
  


Current Time: Fri Mar 29 06:57:51 GMT 2024

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

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

Back to the top