It is recommended that you use now the SUN javac compiler. It has been improved and should work well for your needs.
man javac
gives you documentation about the compiler.
which javac
tells you where it lives.
But jikes from IBM is also available.
To compile:
jikes -classpath $CLASSPATH\:$JIKESPATH -d . -g +E *.java(where JIKESPATH has the Java system classes, currently /arch/unix/packages/j2sdk1_3_0beta/jre/lib/rt.jar on Solaris). You have to introduce an environment variable JIKESPATH, for example in your .software file. I use:
JAVA_HOME=/arch/unix/packages/j2sdk1_3_0beta # Location of JDK libs, for the Jikes compiler JIKESPATH=$JAVA_HOME/jre/lib/rt.jarin my .software file. (The Java 2 SDK should already be in your path, if you have e.g. "@all" or "@gnu-all" in your .software file; use
which javato find out where the current version is.)
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 from the Java 2 SDK. Why should you use jikes over javac? jikes gives you better error messages and it compiles much faster.
To run:
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 the runtime support package (edu.neu.ccs.demeter.*), as well as DJ (edu.neu.ccs.demeter.dj.*) and the AP Library (edu.neu.ccs.demeter.aplib.*, edu.neu.ccs.demeter.aplib.cd.*, and edu.neu.ccs.demeter.aplib.sg.*).
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 jre/lib/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 and Doug Orleans.