How to compile and run Java programs at CCS

On Solaris, at CCS:

Please use at least Java 1.4. You can find it in

  /bin/javac
You might need to put this on your path in your shell initialization file or .software file.

It is recommended that you use the SUN javac compiler. It has been improved and should work well for your needs.

javac documentation.

  which javac
tells you where it lives.

To run:

java Main
provided Main contains the main() method.

Compiling Java files that have been created by DemeterJ.

In some homeworks you get generated Java files to take the tedious work from you. The Java files live in a directory that has usually the name gen. Contents of generated java code.

To compile and run the provided Java classes, you need to put the rt.jar file mentioned in the Demeter software installation guide 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.*). To compile the generated Java classes, use:

javac *.java
To run the program, use:
java Main < program.input
where 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.

Prepared by Karl Lieberherr and Doug Orleans.