Princeton University
Computer Science Dept.

Computer Science 441
Programming Languages
Fall 1998

Instructions on using GJ


To run GJ, I suggest you add the following to your .cshrc file:
   alias gjc java -ms12m gjc.Main
   setenv CLASSPATH .:/usr/local/gj/classes
This makes gjc a command for compiling Java and GJ programs. The CLASSPATH is the path used by the compiler for looking up any compiled classes that you may need. The defaults given here include the directory you are running the command from and /usr/local/gj/classes. Feel free to add other directories to your classpath if you start developing your own libraries.

Compile your program by typing

   gjc MyProg.java
That will not only compile that file, but any other file needed by your program (provided it can be found using the info in CLASSPATH).

To run your program type

   java MyProg
presuming that MyProg is the class whose main method is the one you want to execute.

The best place to get information on gj is the GJ homepage, which has links to documentation on how to use the system and a tutorial. GOOD LUCK.