Skip to content

Instantly share code, notes, and snippets.

@alexsurelee
Last active September 5, 2019 03:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexsurelee/ab6c067d78205ec1bb19839d04482196 to your computer and use it in GitHub Desktop.
Save alexsurelee/ab6c067d78205ec1bb19839d04482196 to your computer and use it in GitHub Desktop.
How to run the ModelChecker tool for SWEN324 where you have a newer version of Java installed.

Running ModelChecker on Mac

If, like me, you've got a newer version of Java installed on your system and couldn't run ModelChecker.jar without issues, follow this cheeky li'l guide to get set up.

Download Java 1.8

Firstly, you're gonna need to get Java 1.8 if you don't already. This can be found here. Unfortunately, you need to make an Oracle account to download it :(

After installing, run /usr/libexec/java_home -V - this should list all of the versions you have installed. Check that there is 1.8.0_221, x86-64: "Java SE 8" listed.

Once you've got that sussed, go into your SWEN324HandBuild folder.

Create a run script

Make a new text file, and name it run.command. The contents of this file should be:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_221`
java -jar ModelChecker.jar

Save that, then run chmod u+x run.command in your terminal (within the SWEN324HandBuild folder).

Now, you should be able to launch the application via ./run.command.

The script will set your java version for that instance of your terminal to be 1.8, and then launch the program. If you need to use the later versions of Java again, just make sure you quit the terminal first!

Double-checking your default Java version

To make sure that you've got the right version set, try running java -version in your terminal. This should list whichever version is set to your default.

Hopefully, in a new terminal window this'll be whatever version you want to normally use, but after running the script it should show version 1.8. This should reset each time your terminal application is quit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment