Download and Setup HabaneroJava (HJ) Package
Note that the HJ package is meant to run only on Linux and MacOS. If you have a Windows machine, you will have to remotely login to one of the lab machines and work on it. Please contact the staff if you need help to do that.
HJ - Download and Install
You will have to download and install HJ once for every machine you plan to use HJ on.
- Download the zip file containing the HJ package from https://svn.rice.edu/r/comp322/course/downloads/hj-1.2.0-2011-01-06.zip
- Lets call the zip file ’hj-version.zip’.
- Unzip the file
unzip hj-version.zip - This will create a folder, namely 'hj-version'
HJ - Setup
You will have to setup the environment before you can compile and run HJ programs. This has to be done every time you login to a machine or start a new shell. These commands are specific to the shell you use.
...
- Set the environment variable HJ HOME to the ’hj-version’ folder.
setenv HJ_HOME <full-path-to-hj-version-folder>
OR
<Go to the hj-version folder>
setenv HJ_HOME `pwd`
Note that you need to use `backquote` in the above command. - Set the environment variable PATH.
setenv PATH ${HJ_HOME}/bin:${PATH} - You should have the environment variable JAVA_HOME set to run HJ programs. Some machines would have it set when you log in. If it is not set already, you have to set it as follows.
Check if your JAVA_HOME is set.
echo $JAVA_HOME
If this prints an empty line, it is not set. Do the following.
setenv JAVA_HOME <full-path-to-java-sdk>
In your lab machines, the java sdk can be found at /etc/alternatives/java sdk sun.
HJ - Testing
Now you are all set to compile and run HJ programs. Here are the instructions to compile and run an HJ program in the command line.
- Go to the folder ’hj-version/examples/HelloWorld’ which contains an HJ program, HelloWorld.hj.
- Compile the HJ program
hjc HelloWorld.hj - Run the HJ program
hj HelloWorld - This should print ’HelloWorld’.
- To control the number of places and threads your HJ program runs on, use the ’-places’ option as follows.
hj -places 1:2 HelloWorld // This runs on 1 place with 2 threads
DrJava-HJ - Download and Install
DrJava-HJ is the gui for HJ. You can edit, compile and run HJ programs from within this gui.
- Download the jar file corresponding to DrJava-HJ from https://svn.rice.edu/r/comp322/course/downloads/drjava-r5422-hj-1.2.0.0.jar
- Lets call the jar file ’drjava-hj-version.jar’.
DrJava-HJ - Setup
There is no setup needed for DrJava-HJ.
DrJava-HJ - Testing
Here are the instructions to compile and run HJ programs using the DrJava-HJ gui.
...