diff --git a/README.md b/README.md index 72b09d4..766d29d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,78 @@ #j2js-compiler A Java Bytecode to JavaScript Cross-Compiler. + +##Installation + +1. You need to install this and the following projects + +* https://github.com/decatur/j2js-compiler +* https://github.com/decatur/j2js-jre +* https://github.com/decatur/j2js-agent + +2. Build all projects. An Eclipse project description is included. + +3. Optionally install https://github.com/decatur/j2js-demos + +##Usage + + java -cp com.j2js.J2JSCompiler + +###`` + +This is the standard Java classpath. +The cross-compiler needs the project j2js-compiler, bcel and commons-io on its classpath. + +###`` + +All non-absolute paths are relative to the basedir. + +###`` + +The name of the class to cross-compile. This class must have a method +`public void main(java.lang.String[])`. + +The compiler cross-compiles the `main` method and all other methods which are called from the `main` method. + +###`` + +This classpath must contain all classes whose methods are referenced by the main method. +In normal operation, this classpath consists of +* the j2js-jre classes directory or jar +* the j2js-agent classes directory or jar +* the classes directory of your personal project + +###`` +All cross-compiled code is stored in the target location. It is one or more JavaScript file starting at +`0.js`. Only this initial file must be included in your web page with +`