The Basics for Using JML
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:
The necessary files to run the JML checker are installed on unix3 in the 308 directory
To execute the JML checker from the Unix command line, do the following:/home/gfisher/classes/308/bin/openjml
where the command goes on a single line, FILES.java are the paths of one or more Java modeling files.OPENJML=/home/gfisher/classes/308/bin/openjml java -Xbootclasspath/p:$OPENJML/openjmlboot.jar -jar $OPENJML/openjml.jar -noPurityCheck FILES.java
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 $*)
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.