2

I know that SWT has two versions, 32bit and 64bit.

That is the source of problem. I have a project using SWT in Eclipse IDE, my OS and Eclipse developing environment are all in 64bit. Certainly, in this project, I refer the SWT 64bit jar package for running or exporting.

But, my colleague's computer is running on 32bit windows 7. They can not run my JAR with SWT 64bit, and I have to remove the SWT 64bit package from my project and add the SWT 32bit package to it, and export again this runnable JAR which included SWT 32bit for my colleague.

It troubles me.

There is a stupid but efficient way to complete this task. I just need to create two projects, one includes the SWT 32bit package and another has the SWT 64bit package, every time I make a little change, I need to copy the java code from 64bit project to 32bit project. That is just the point I hated.

Because I only try to keep one copy java codes for two different OS platform's exportation.

What should I do? Does Ant or Maven have a good choice? I don't familiar with them, but if it needs, I can learn.

lukenothing
  • 149
  • 1
  • 6
  • possible duplicate of [Create cross platform Java SWT Application](http://stackoverflow.com/questions/2706222/create-cross-platform-java-swt-application) – Baz Apr 23 '14 at 18:44
  • @Baz Thanks, I have solved this trouble. I copy the project with SWT 64bit to a new project, then change its configures for SWT 32bit. Exporting each project to the runnable JAR with checked "Save as ANT script" to different names, buildwin32.xml and buildwin64.xml, and copy two ANT scripts and jar-in-jar-loader.zip into the project with SWT 64bit. Until now, I can debug, run the project in my 64bit enironment, and pick the buildwin32.xml to run in a ANT builder, it will create a runnable JAR for win32, pick the buildwin64.xml to run in a ANT builder, it will create a runnable JAR for win64. – lukenothing Apr 23 '14 at 23:40
  • Finally, delete the project with SWT 32bit. – lukenothing Apr 23 '14 at 23:41

0 Answers0