Jaxxc

From JAXXWiki

jaxxc is the JAXX compiler, which is responsible for translating JAXX files into Java .class files.

Contents

Usage

Using jaxxc is very similar to using javac:

> jaxxc com/mycompany/MyApplication.jaxx -d /project/build

This will produce a class named com.mycompany.MyApplication, located at /project/build/com/mycompany/MyApplication.class. Because JAXX files do not contain package or class statements, jaxxc relies on the source path to specify the package and class name information. In this case the generated class is named com.mycompany.MyApplication because the path passed into jaxxc was com/mycompany/MyApplication.jaxx. Make sure that the paths you pass into jaxxc cause the compiled classes to end up with the right names.

jaxxc understands dependencies on other .jaxx files and will automatically compile (or recompile) any directly referenced .jaxx files that either do not have corresponding .class files or have out-of-date .class files.

Command-line options

jaxxc supports the following command-line options, all of which are optional:

OptionDescription
-classpath <paths> (may be abbreviated -cp)Additional paths to search for user-defined classes. Works exactly like javac's -cp option.
-d <path>Target path for compiled class files. All classes produced during compilation will be placed into the correct package structure under this root path. Works exactly like javac's -d option.
-keep (may be abbreviated -k)Keep generated Java files. jaxxc compiles each .jaxx file into a .java file, and then invokes javac to compile the .java file into a .class. The intermediate .java files are then deleted unless this option is specified. This option is very useful for debugging errors which occur in the generated .java files.
-java (may be abbreviated -j)Only generate .java files. When this option is specified, jaxxc will compile .jaxx files into .java files and then quit.
-javac_opts <options>Extra parameters to be passed into javac. If more than one parameter is specified, they should be put in quotes.
-versionPrint version information and then quit.

Environment variables

If the JAXX_OPTS environment variable is set, its contents will be passed as command-line arguments to the java session in which JAXX runs. JAXX_OPTS can be used to control any of Java's parameters, but it is particularly important for adding additional SPI .jar files to JAXX's class path.

Ant task

If you use Ant as part of your build process, there is an Ant task to run jaxxc.