This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
It works well in Eclipse, since I can set the project to reference the jar "swt.jar".
Let's say I want to deploy this, do I have to extract everything inside "swt.jar", then re-jar those files with SWTHelloWorld.java? Or can I just say something like "import swt.jar", and use everything inside it.
Thank you for all your help. [ August 07, 2008: Message edited by: ManChun Lam ]
When you create a JAR file with your own application, you can specify the classpath:
This path is relative to your own JAR file, so with that example you should just put the swt.jar file in the same folder as your JAR file. You can also choose to use subfolders.
Note that you should NOT put swt.jar INSIDE your JAR file, because then you will have to use some workarounds which are, in my opinion, not worth it.
I understand your point in editing the Manifest. However, my code will not even compile unless I extract everything inside swt.jar.
To better illustrate the problem:
Directory: C:\Test Files inside Directory:
SWTHelloWorld.java
swt.jar
The compiler will not compile because it can't find the directory org/eclipse/swt/*, etc, even though they are inside swt.jar. Is there a way to compile SWTHelloWorld without extracting swt.jar?
Thanks, that solves the compiling problem but when running it
I get this error,
If I compile and run it with swt.jar extracted, everything is fine.
Am I missing something?
Thank you for your help.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
9
posted
0
You need to specify the classpath for compilation and at runtime:
Note that the dot is important, otherwise the SWTHelloWorld class won't get found. (This assumes that you're using Windows; if you're on Unix, use a colon instead of a semicolon.)
ManChun Lam
Greenhorn
Joined: May 04, 2008
Posts: 28
posted
0
That solves my problem. Thank you very much for your help.