2

Java Desktop application: SWT vs. Swing

"requires native libraries for each supported system"

Does it mean that i have to rebuild my project for each OS, switching each time the libraries to the corresponding target's native library? Or is there a way to actually put every libraries required by different OS in the same project?

I just started Java, as my second language, sorry if this question look stupid.

Community
  • 1
  • 1
user1115057
  • 1,815
  • 2
  • 18
  • 20

1 Answers1

1

No, you don't need to rebuild your project. You just need to make sure you bundle the correct SWT native library for each platform (.dll, .so etc.) with your program -- SWT has built-in logic to determine the platform and load the correct library.

casablanca
  • 69,683
  • 7
  • 133
  • 150
  • So you mean i have to download every native library and put all of them in my project? Can you explain more how to bundle them? – user1115057 Feb 20 '12 at 06:09
  • I mean, do i have to download all of those: http://download.eclipse.org/eclipse/downloads/drops/R-3.7.1-201109091335/index.php#SWT – user1115057 Feb 20 '12 at 06:11
  • @user1115057: You have to download the libraries for whichever platforms you are targeting. "Bundling" should be as simple as putting the library in the same directory as your JAR file. Also, you don't need all libraries at the same time - you can package your application separately for each OS and bundle only the corresponding libraries with it. – casablanca Feb 20 '12 at 06:20