Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

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

(Added new FAQ's to see also section)
m
 
Line 5: Line 5:
 
yes! However, because SWT has a native component, the
 
yes! However, because SWT has a native component, the
 
technical details are a bit more involved than they are for simple Java libraries.
 
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
 
Each platform you want your project to run on will need its own native
Line 21: Line 18:
 
path and that both <tt>swt.jar</tt> and the SWT dynamic link  
 
path and that both <tt>swt.jar</tt> and the SWT dynamic link  
 
library are located in the current working directory.
 
library are located in the current working directory.
 
 
 
 
  
  

Latest revision as of 20:49, 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&#146;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.

Back to the top