GJ

Home
Mirrors
Distribution
Documents
Applications
People
Pizza

A Generic Java Language Extension

Compiler Installation

GJ is implemented on top of the Java Development Kit (other Java-compatible virtual machines will also work). The GJ compiler gjc is a straight replacement for Sun's Java compiler javac. When compiling .java files, gjc works just like javac, except that it's up to 2 times faster for large sources.

This page describes the procedure for downloading and installing GJ for UNIX and Windows '95 systems in six easy steps. If you know something about Java, you can also install GJ on any other conforming Java system by proceeding analogously to what's described here.

We recommend that you also subscribe to the Pizza mailing lists, which notify you of updates to this distribution and provide answers to questions relating to GJ and Pizza.

  1. Get the Java Development Kit, in case you don't have it already. You'll need to have JDK 1.1 or higher.

  2. Get the GJ distribution, either as a zip archive or as a gzipped tar file.

  3. Pick a directory for unpacking and unpack the distribution into it. This will create a gj directory with three subdirectories classes, src and doc.

  4. Include the gj/classes subdirectory in your CLASSPATH. Alternatively, move the gj/classes directory into some other directory on your CLASSPATH. In case the CLASSPATH environment variable is not yet defined you need to set it now.

    You should now have a directory, say `X', in your CLASSPATH such that

    `X'/gjc/Main.class
    exists. Make sure that this is the case.

  5. On UNIX systems, set an alias (csh syntax used here).
    alias gjc java -ms12m gjc.Main
    On Windows systems, you can use the file gjc.BAT, which is part of the distrution. Be sure to put this file into a directory which is in your executable path. Note that the file gjc.BAT contains the single line:
    java -ms12m gjc.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
    The option -ms12m sets the initial heapsize of the Java interpreter to 12MB, the recommended size for GJ. Depending on your system, you might want to choose a different size.

  6. You can now invoke the GJ compiler with the command
    gjc options sourcefiles
    Simply typing gjc will give you a list of all available options. Source files should have extension .java

  7. Options you plan to use all the time may be included in the alias or .BAT file. One commonly defines a fixed output directory for compiled classes with
    -d directoryname
    The output directory should be listed in your CLASSPATH. Frequently the output directory will be the one that also contains the gjc directory.

Comments and bug reports to the Pizza Group, pizza@cis.unisa.edu.au. Java is a trademark of Sun Microsystems. All software and documents on the Pizza site are © Copyright 1996, 1997 by the respective authors as attributed on each. Terms for redistribution are available.