IBM alphaWorks
E-Mail Site Map
Search

alphaWorks
Internet Access Required Internet Access Required alphaWorks Press and Awards Information about alphaWorks Internet Access Required XML Tutorials and Papers
Jikes                                                                                                                                            | Overview | FAQ | Requirements | Discussion |

OVERVIEW
These files are the "stable" version of Jikes, meant for those who just want to use Jikes to compile their programs. Those wishing to obtain more recent "development versions", and the Jikes Test Suite, should consult http:// www.ibm.com/research/jikes.

Jikes is a Java compiler that translates Java source files as defined in The Java Language Specification (Addison-Wesley, 1996) into the bytecoded instruction set and binary format defined in The Java Virtual Machine Specification (Addison-Wesley, 1996). Unlike other compilers, Jikes accepts the Java language only as specified: not as a subset, variant, or superset.

In addition to strictly adhering to specifications, Jikes is faster than most compilers and can compute the complete dependency relations in program files. This allows for the generation of dependency makefiles suitable for use with make. Jikes can also be run in incremental mode: after the initial compilation, Jikes waits until prompted, determines which files have been changed, and then does the minimal amount of work needed to bring the class files into a complete and consistent state. This cycle can be repeated until the q command is entered to end the compilation.


FAQ

  1. How do I use Jikes? What options does it support?

    You can use Jikes the same way you use most Java compilers. It supports most of the commonly used options. You can invoke it with no arguments to get a brief description of the options you can use. The supported options are:
    -ggenerate LocalVariableTable attribute

    -Odo not generate LineNumberTable attribute

    -debugno effect (recognized for compatibility with many compilers)

    -dependrecompile all used classes

    -nowarnsuppress warning messages

    -verboselist files read and written

    -classpath pathset classpath

    -nowritedo not write any class files

    -d dirwrite class files in specified directory

    ++compile in incremental mode

    Go by the book (see FAQ included with download for details).

    +Dsuppress checking of definite assignment

    +Elist errors in a form commonly used by emacs to scan for errors. By default errors are listed in a more readable form.

    +Fdo full dependence check except for Zip and Jar files

    +Mgenerate makefiles with dependencies

    +Vdetailed, veracious error listing

    +Udo full dependence check including Zip and Jar files

    You can use Jikes the same way you use most Java compilers. It supports most of the commonly used options. You can invoke it with no arguments to get a brief description of the options you can use. The supported options are:
    -ggenerate LocalVariableTable attribute

    -Odo not generate LineNumberTable attribute

    -debugno effect (recognized for compatibility with many compilers)

    -dependrecompile all used classes

    -nowarnsuppress warning messages

    -verboselist files read and written

    -classpath pathset classpath

    -nowritedo not write any class files

    -d dirwrite class files in specified directory

    ++compile in incremental mode

    Go by the book (see FAQ included with download for details).

    +Dsuppress checking of definite assignment

    +Elist errors in a form commonly used by emacs to scan for errors. By default errors are listed in a more readable form.

    +Fdo full dependence check except for Zip and Jar files

    +Mgenerate makefiles with dependencies

    +Vdetailed, veracious error listing

    +Udo full dependence check including Zip and Jar files



  2. How does Jikes support incremental compilation?

    Jikes can be run in an incremental mode that works as follows:

    Open a window and compile your program using

    jikes ++ Main.java

    where Main.java denotes your root source file. Jikes will then compile Main.java and all the files it references, building a complete set of dependencies, and will then wait for input. Modify your source files using your favorite editor until you are ready to rebuild your program, and then type an empty line in the window in which Jikes is waiting. Jikes will then determine which source files have been changed, and will then perform the minimum number of compilations needed to bring the class files into a complete and consistent state. You can repeat this cycle as you wish, until you terminate the compilation by typing a single line: q in the window in which Jikes is waiting.
    Zip files in CLASSPATH are assumed to be unchanging, and are not included in the dependency analysis. This limits the number of class files that must be read.

  3. Is Jikes related to Visual Age Java?

    As you may know, IBM has a VisualAge Java development system in beta test. The Jikes compiler project is not part of the VisualAge system, but either or both of these IBM efforts might be helpful to your Java development. Note that both these efforts conform to the same version of Java, namely that defined in the open, published specifications. VisualAge for Java will be a comprehensive, integrated development environment with lots of state-of-the art features ([
    Take a peek!]).The scope of Jikes is smaller: it compiles .java files to .class files. We think Jikes will be useful to you if you have a collection of Java development tools that you are satisfied with but you need a fast compiler that implements the Java language specification accurately.

  4. How do I use Jikes to generate dependencies for make?

    Use the +M option to request that Jikes create a file X.u for each file X.class that is compiled, and include a list of all the files that X.class depends on. Zip files in CLASSPATH are assumed to be unchanging, and are not included in the generated makefiles, mainly to avoid cluttering up the dependency list with voluminous dependencies on the contents of java.

  5. How does Jikes process programs differently from other compilers?

    Here are a few examples of constructs that Jikes handles according to specifications. See the FAQ included in the download for more examples. [

    Extraneous Semicolons. Your program may contain extraneous semicolons that are silently ignored by many compilers. Jikes treats then as cause to issue a warning. You can use the -nowarn option to suppress these warnings.

    Unreachable Statements. It is a compile-time error if a statement cannot be executed because it is unreachable (section 14.19). Many compilers don't properly detect unreachable statements, and accept programs such as the following (which Jikes rejects):

    class Test {
    void method(boolean b) {
         if (b) return;
         else return;
         b = !b;
    }
    }
    Another example, and one that confuses many users, is shown by the following program:

    class Test {
    public static void main(String[ ] args){
       try {
       }
       catch (Exception e) {
         System.out.println("caught");
       }
    }
    }

    Jikes accepts this program but issues the warning:

    catch (Exception e) { <---------> *** Warning: This catch block is unreachable: there is no exception whose type is assignable to "java/lang/Exception" that can be thrown during execution of the body of the try block.

    See Section 14.1: since execution of the (empty) try block can throw no exception, the catch block is not reachable. Jikes will detect similar errors, even when the try block is not empty, based on its analysis of the program. (This is one area where the specification is a bit murky, and this murkiness is the reason Jikes treats this as cause for issuing a warning and not an error.)

    Definite Assignment. Some compilers accept the following program:

    public class Test {
    public static void main(String args[ ]) {
          L1: for (int i = 1;  i < 11;  i++) {
               int j = 1,
               k;
               L2:
                do {
                        if (j == i)
                             continue L1;
                             j++;
                             k = 0;

                        } while (j < 10);
                          int l = k; // an error should be emitted here !
                 }
           }
    }

    which Jikes rejects:

    int l = k; // an error should be emitted here !

    *** Semantic Error: The variable "k" is accessed before having been definitely assigned a value

    Problems with break Statement. Many compilers have trouble with the following program. Some crash during compilation; others complain about a missing label:


    class Test {
    public static void main(String[ ] args) {
         Label:
         try {
         }
         finally {
             break Label;
         }
    }
    }
    Jikes accepts this program.


REQUIREMENTS
Click here to view the
Installation Procedures

Jikes Platform Requirements
Computer 486 or greater
Platform Windows 95/NT, AIX, OS/2, Linux, and Solaris Sparc
Java tool JDK or JRE


Jikes Installation Procedures

  1. Download and run Jikes. We suggest you put Jikes in the same directory as your usual Java compiler. This requires no changes to any system startup files.
  2. You must supply a definition for CLASSPATH as discussed in the FAQ (jikesfaq.html) that is included in the download.


DOWNLOADS
File Size Comments  
jikes-aix_tar.Z 1523 KB Binary tar file containing Jikes for AIX (v0.47)
jikeswin.exe 394 KB Binary self-extracting file containing Jikes for Windows 95/NT (v0.47)
jikes-linux-intel-glibc_tar.gz 603 KB Binary gz file for Jikes for Linux Intel (requires glibc) (v0.47)
jikes-solaris-sparc_tar.Z 930 KB Binary tar file containing Jikes for Solaris Sparc (v0.47)
jikes.zip 453 KB zip for Jikes Compiler Source (v0.47)
jikes_tar.gz 419 KB gz for Jikes Compiler Source (v0.47)