Difference between revisions of "FAQ Can I use SWT outside Eclipse for my own project?"

From Eclipsepedia

Jump to: navigation, search
 
(Added new FAQ's to see also section)
Line 28: Line 28:
  
 
== See Also: ==
 
== See Also: ==
 
+
*[[FAQ How do I configure an Eclipse Java project to use SWT?]]
 
+
*[[FAQ How do I create an executable JAR file for a stand-alone SWT program?]]
[[FAQ_How_is_Eclipse_licensed%3F]]
+
*[[FAQ_How_is_Eclipse_licensed%3F]]
 
+
*[[FAQ_How_do_I_display_a_Web_page_in_SWT%3F]]
 
+
[[FAQ_How_do_I_display_a_Web_page_in_SWT%3F]]
+
  
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>

Revision as of 20:48, 31 March 2008

This can be interpreted as either a legal question or a technical question. You can find an official answer to the legal question on the SWT FAQ hosted on the SWT development team home page at eclipse.org. The answer to the technical question is an unqualified yes! However, because SWT has a native component, the technical details are a bit more involved than they are for simple Java libraries.



Each platform you want your project to run on will need its own native libraries. Luckily, this is easier than it used to be because the download section of eclipse.org now includes SWT drops. Download the appropriate SWT drop for the platform you are interested in running on, and set up the VM’s classpath and library path accordingly. Here is a command line that was used to launch the BrowserSnippet stand-alone program:

   java -cp swt.jar;. -Djava.library.path=. BrowserSnippet

This command line assumes that java is on your execution path and that both swt.jar and the SWT dynamic link library are located in the current working directory.




See Also:


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.