Tutorial - Step by Step
3. Specify Resources
After clicking Next, you will be forwarded to the resources page. You need to specify all the resources needed by your application.
3.1 Specify Java Runtime Env.
Note that a <resources> element with subelement <j2se> has been automatically created for you.
Tip: To modify an element, simply click it, proper controls will be show at the bottom of the page.
First we specify the resources to deploy this application on Windows. Select <resources> element, put Windows to the OS name field. You can also specify the OS arch if you like.
The <j2se> element says that this application needs JRE with version 1.3 or above.
3.2 Add your program code
Next we want to include the binary code of our application. To do this, right click on the resource tree field, and select: Add a <jar> resource
Once you clicked, the newly created <jar> is selected and it asks for the compulsory Href value. Click Create and jar wizard is brought up. Create the a jar including at least the java code and resource bundle. You can put the jar anywhere you want. Click finish to actually create the jar and return to web start wizard. You should see something like the following:
In options, select true in the Main combo - becase
this jar contains the main class to be specified.
3.3 Add Java libraries
We have put our own code to the resources, now it's time to put the library to it. Right click on the resource tree field, and click Add a <jar> resource. Just now we create a jar on the fly; since SWT.jar already exists, we can simply browse it by clicking the browse button. [SWT.jar locates at [ECLIPSE_INSTALL_DIR]\plugins\org.eclipse.swt.win32_3.0.0\ws\win32 on Windows]
Remember that SWT relies on OS-dependent native library, we need put it in the <resources> too.
3.4 Add native libraries
Right click on the resources tree field and click Add a <nativelib> resource. SW4E is not picky, you can either browse/create the jar file containing the native libary or simply browse the native library itself. Click browse and select [ECLIPSE_INSTALL_DIR]\plugins\org.eclipse.swt.win32_3.0.0\os\win32\x86\swt-win32-3024.dll , note the number 3024, which is the release serial of the SWT, so you may have a different number.
In this section, we have specifies the JRE, program code, java libraries and native libraries. You can specify them in any order. The final resources tree looks like this:
Similarly, you can create a new <resources> and specify Linux-dependent libraries.
Press Next to continue.