CS 334
Programming Languages
Spring 2000

GJ Instructions


The standard student versions of .bashrc has been set up to contain an alias, gjc, for running GJ programs, and have modified the paths to gain access to the appropriate GJ files. If you use non-standard .bashrc or other files, please see the on-line versions in home/cs-students/standard/.bashrc for the alias to gjc and for setting up CLASSPATH.

The command gjc is used 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.

Before compiling your program you must type

   source setupgjc
This sets up your path correctly to run GJ. If you are taking Software Engineering, you will likely have to set your path back to its original form to run the software there. You can do that by executing source resetclasspath. Once the path has been set properly, you may 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.