It is important that you turn the Just-In-Time compiler feature off for the Java compiler you use. This feature is still buggy and causes weird run-time errors. I turn it off, by putting into my .software file:
jikes -classpath $CLASSPATH\:$JIKESPATH -d . -g +E *.java(where JIKESPATH has the Java system classes, i.e. /usr/java1.2/jre/lib/rt.jar on Solaris). You have to introduce an environment variable JIKESPATH, for example in your .software file. I use:
JAVA_HOME=/usr/java1.2 PATH=$JAVA_HOME/bin JAVA_COMPILER=NONE # Location of JDK libs, for the Jikes compiler JIKESPATH=$JAVA_HOME/jre/lib/rt.jarin my .software file.
The +E gives error messages in a format that Emacs can parse. "jikes -help" shows all the available options.
jikes is at:
/arch/com/bin/jikesAn alternative to jikes is to use javac which is at /bin/javac. Why should you use jikes over javac? jikes gives you better error messages and it compiles much faster.
java Mainprovided Main contains the main() method.
To get jikes for your machine, use: Jikes compiler home page.
To compile and run the provided Java classes, you need to put the file at http://www.ccs.neu.edu/research/demeter/DemeterJava/rt.jar into your CLASSPATH. This jar file contains only a few classes like Ident that are needed to run the provided program. They are all in the package EDU.neu.ccs.demeter.*.
The same file is also at: /proj/demsys/demjava/rt.jar for users of CCS Solaris machines. To compile them, use:
jikes -classpath $CLASSPATH\:$JIKESPATH -g *.javaIf you prefer to use javac, you can simply use:
javac *.javaTo run the program, use:
java Main < program.inputwhere program.input contains an object description that is given as input to your Java program. Study class Main.java to see how the parser is invoked.
In one command, in csh or tcsh,
env CLASSPATH=$CLASSPATH\:$JIKESPATH demjava MODULENAMEThis is equivalent to, in sh, ksh, or bash,
CLASSPATH=$CLASSPATH:$JIKESPATH demjava MODULENAMEwhere MODULENAME is one of the allowed modules, e.g. test, new, etc. Run demjava -help to see all possible module names. In the *.prj file it is recommended that you use
// Java compiler arguments. COMPILE_ARGS = -g -depend +Efor the compiler arguments.
From Doug Orleans: The crux of the matter is that jikes needs the Java library classes to be on the classpath, and the way it handles its own JIKESPATH variable is sort of strange (it doesn't add JIKESPATH to the CLASSPATH, it uses one or the other but not both). But I didn't feel comfortable just putting /usr/java1.2/jre/rt.jar in my CLASSPATH permanently, because Java doesn't need it. So I do it as I've described. Your mileage may vary.
Prepared by Karl Lieberherr with input from Doug Orleans and Johan Ovlinger.