CS 334
|
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 setupgjcThis 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.javaThat 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 MyProgpresuming 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.