Configuring your Java2Script application launcher.

A very important part of Java2Script plugin is the application launcher configuration. By default, Java2Script applications will be launched from local filesystem and will point to the j2slib.js file that is inside your eclipse's plugins/ directory.

When you run your application the first time, a Java2Script application launcher configuration is created. For editing it, you just rught click on you java file -> Run Configgurations... As you may see, there are two new tabs in the application launcher configuration.

The first tab, HTML, is used to introduce html code at the <head> or <body> html elements of the generated html document, like scripts, CSS stylesheets, etc. We will call this tab the "HTML configuration tab":

Figure 3-4. Launch a Java2Script application - the J2S Console view

The Miscellaneous tab is used to specify, among other things, the location of the j2slib.js file, the location of generated .js files (the bin/ folder URL), firefox addon support, etc:

Figure 3-5. Launch a Java2Script application - the J2S Console view

The most important item to configure here is the location of j2slib.js file. By default, Java2Script are launched pointing to plugins/ internal j2slib.js filesystem version, for example :


   <script type="text/javascript" src="../../j2s_3.6_workspace/net.sf.j2s.lib/j2slib/j2slib.z.js">
   

This is aceptable for developing because the Java2Script application will be loaded fast from filesystem. Nevertheless, you should change this if you want to deploy your application to a web server. A common practice is to copy your eclipse classic helios/plugins/net.sf.j2s.lib_2.0.0/j2slib/ folder inside your Java2Script project and configure the application launcher to use a Global .js URL for your j2slib base:

Figure 3-6. Launch a Java2Script application - the J2S Console view