...
- 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
...
DrHJ - Download and Install
DrJava-HJ is the gui DrHJ is an IDE for HJ. You can edit, compile and run HJ programs from within this gui.IDE. DrHJ runs on Unix-based platforms (e.g., Ubuntu, Mac OS, etc) and also on some Windows installations. (For Windows, you should download a standard full JDK from Oracle to maximize the chances of DrHj working on your system.)
- Download the jar file corresponding to DrJava-HJ DrHJ
- Lets call the jar file ’drjava-hj-version’drhj.jar’.
DrHJ - Setup
There is no setup needed for DrHJ.
...
- Open the DrHJ IDE
java -jar drjava-versiondrhj.jar - Now you should have the DrHJ IDE 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 ’hj-version/examples/HelloWorld’, which contains an HJ program, HelloWorld.hj
Select HelloWorld.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 HelloWorld - DO NOT use the IDE with different options for ’-places’.
- DO NOT use the IDE for timing your executions.