The Basics for Using JML



Introduction

As described in the Java Modeling handout, we are doing two levels of modeling in Java:

Detailed coverage of JML is provided in the following sources:

Running JML on CSL Unix Machies

The necessary files to run the JML checker are installed on unix3 in the 308 directory

/home/gfisher/classes/308/bin/openjml
To execute the JML checker from the Unix command line, do the following:
OPENJML=/home/gfisher/classes/308/bin/openjml
java -Xbootclasspath/p:$OPENJML/openjmlboot.jar -jar $OPENJML/openjml.jar
    -noPurityCheck FILES.java
where the command goes on a single line, FILES.java are the paths of one or more Java modeling files.

You can make this setup more convenient by adding the following lines to your file ~/.bashrc:

OPENJML=/home/gfisher/classes/308/bin/openjml
export OPENJML

function jml() (java -Xbootclasspath/p:$OPENJML/openjmlboot.jar -jar $OPENJML/openjml.jar \
    -noPurityCheck $*)

Downloading and Installing on Your Own Computer

You can download the Open JML tools from the JML homepage. The tools are installed in the same way as on unix3. There is a JML Eclipse plug-in, but the commmand-line version is most likely your best bet for 308.