This repository was archived by the owner on Mar 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Install
decatur edited this page Oct 5, 2011
·
10 revisions
Download or git pull these projects:
Import the projects into an Eclipse workspace and build the projects.
Switch into j2js-demos project.
Set the runtime classpath
set RUNTIME_CLASSPATH=^
%COMPILER_DIR%/libs/1.4/commons-io-1.4.jar;^
%COMPILER_DIR%/libs/bcel-5.1.jar;^
%COMPILER_DIR%/target/classes
and query the cross-compiler usage:
java -cp %RUNTIME_CLASSPATH% com.j2js.J2JSCompiler
This will output
Usage: java com.j2js.J2JSCompiler <basedir> <classpathElements> <entryPointClassName> <targetLocation>
Note: You can also execute the MS-Windows batch compile-hello-world.bat
With the runtime classpath alread set, we now have to set the cross-compile-time classpath:
set CROSS_COMPILE_CLASSPATH=^
target/classes;../j2js-jre/target/classes;../j2js-agent/target/classes;
Generate the JavaScript assemblies for the class j2js.demo.HelloWorld1 into the location
./target/assemblies/HelloWorld1:
java -cp %RUNTIME_CLASSPATH% com.j2js.J2JSCompiler . ^
%CROSS_COMPILE_CLASSPATH% j2js.demo.HelloWorld1 ./target/assemblies/HelloWorld1
Navigate a browser to /j2js-demos/src/main/webapp/HelloWorld1.html.
You should be alerted of "Hello World".