Download and Setup HabaneroJava (HJ) Package
HJ
- Download the zip file containing the HJ package from https://svn.rice.edu/r/parsoft/projects/COMP322/2011/hj-1.2.0.zip
- Now you have the zip file. Lets call it 'hj-version.zip'.
- Unzip the file
unzip hj-version.zip - This will create a folder, namely 'hj-version'
- Set the environment variable HJ_HOME to this new folder, hj-version
cd hj-version
export HJ_HOME=`pwd` - Set the environment variable PATH
export PATH=$HJ_HOME/bin:$PATH - You are all set to run HJ programs
Testing
Do the following to check if your HJ is setup properly.
- Go to a folder with an HJ program. Lets say we go to hj-version/examples/fib/ which contains an HJ program that computes the Fibonacci of a given input number.
cd $HJ_HOME/examples/fib - Compile the HJ program, Fib.hj
hjc Fib.hj - Run the HJ program with appropriate arguments, Fib with an input 10.
hj Fib 10 - You should get the following result, which is the Fibonacci value of 10.
55
DrJava-HJ
- Download the jar file corresponding to DrJava-HJ from https://svn.rice.edu/r/parsoft/projects/COMP322/2011/drjava-r5422-hj-1.2.0.0.jar
- Now you have the jar file. Lets call it 'drjava-version.jar'.
- You are all set to use the DrJava-HJ gui for HJ programs
Testing
Do the following to check if the DrJava-HJ gui is setup properly.
- Open the DrJava-HJ gui
java -jar drjava-version.jar - Now you should have the DrJava-HJ gui running.
- Open a HJ program. Lets say we open hj-version/examples/fib/Fib.hj.
Click on the open button on the top panel
Navigate to the folder containing Fib.hj
Select Fib.hj and click open - Compile the HJ program.
Click on the compile button on the top panel - The 'Compiler Output' tab in the bottom panel should show 'Compilation Completed'.
- Go to the 'Console' tab in the bottom panel and check if there were any errors during compilation. All errors will be shown in RED.
- Go to the 'Interactions' tab in the bottom panel. Run the program by typing the following.
run Fib 10 - You should get the following output.
55