Setup Java2Script Environment from Subversion Repository
- Install Eclipse 3.1/3.2/3.3/3.4/3.5/3.6, and installl Subclipse or install Subversive
- Checkout sources from SVN http://java2script.googlecode.com/svn/trunk/sources
- net.sf.j2s.core (For Eclipse 3.2/3.3/3.4/3.6, please checkout from http://java2script.googlecode.com/svn/branches)
- net.sf.j2s.ui (For Eclipse 3.2/3.3/3.4/3.6, please checkout from http://java2script.googlecode.com/svn/branches)
- Unzip net.sf.j2s.lib/j2slib.zip
If you know about ANT build script, run net.sf.j2s.lib/build/build.xml inside Eclipse, choosing target "j2s.unzip".
If you are not familiar with ANT, you can use your familiar unzip tools, like 7-zip, or winzip to unzip j2slib.zip outside Eclipse. And then refresh project net.sf.j2s.lib.
- Export the above 4 projects as "Deployable plug-ins and fragments" into your current %ECLIPSE_HOME% directory. For example, you may select C:\eclipse as the directory of export destination. Project "net.sf.j2s.ajax" and "net.sf.j2s.lib" must be exported with "Package plug-ins as individual Jar archives" UNCHECKED. And project "net.sf.j2s.ajax" should be exported with "Include source code" option CHECKED, so later you can bind sources much easily.
Attention: As now Java2Script supports Simple RPC, it requires JAVAX_SERVLET classpath variable to build project net.sf.j2s.ajax. You can create such a classpath variable pointing to Tomcat 5.0+'s servlet-apis.jar or plugin org.eclipse.tomcat's servlets.jar or other similar jar.
(Eclipse 3.3 users should not have this problem, just ignore this.) Trying to export this plugin will fail because there are no dependency for JAVAX_SERVLET in the plugin dependencies. In order to export correct plugin, follow the instructions here:
- Export as plugin with sources, ignore the errors
- Select source folder ajaxrpc and export it as Jar into the previous plugin location, replacing older ajaxrpc.jar
If you have installed Java2Script 1.0.0 M2 or earlier, please delete old "net.sf.j2s.*" plugins. If you enhanced JDT core jar, please replace the enhanced JDT core jar with original one which is backuped in %ECLIPSE_HOME%.
- Restart the Eclipse using extra "-clean" argument. Like
you should find the above 4 "net.sf.j2s.*" plugins list in the "Plug-in Details" (Help->About Eclipse SDK->Plug-in Details).
- Now you have your Java2Script development environment! Follow the Getting Started Tutorials for your tour of Java2Script world!
More advanced steps for building totally from sources
- Check out more sources projects
You may have to be patient for the workspace to build these projects for the first time. (If you are just modifying part of codes or update from SVN, the building process will be much quick and accepatble.)
- Clean and rebuild project net.sf.j2s.ajax (net.sf.j2s.ajax is a Java2Script project but was marked as built before Java2Script plugin is installed. So a clean and rebuild process is needed).
- Run Ant Build Script net.sf.j2s.lib/build/build.xml. It will pack all the things required. You can choose "j2s.zip" for building the above j2slib.zip.
- If you want to build with Java2Script feature and update site, you should also checkout projects
Tests from SVN http://java2script.googlecode.com/svn/trunk/tests
- You can checkout the project "org.eclipse.swt.snippets" or other projects.
Though the SWT APIs are already declared in the project "net.sf.j2s.java.org.eclipse.swt", lots of the APIs are not implmented, you may get errors while running some snippets. For example, you can select Snippet1, Snippet176, Snippet172, Snippet109, and others (you may have the joy to find out which snippets works).
- Current tests list