Software Instructions:
How to Edit, Compile, and Run Java Programs on jGRASP
Step #1: Download JDK (Java Development Kit)
-
Go to this website: Java SE Downloads
-
Click on the DOWNLOAD button under JDK.
-
The webpage will change to the Java SE Development Kit 8 Downloads webpage.
-
Just below Java SE Development Kit 8u111, click on the radio button Accept License Agreement.
-
Based on your computer's operating system, click the appropriate download on the right-hand column.
-
Save the executable file.
-
Open and run the executable file.
-
Follow the instructions on the installation wizard. Click Next.
-
Keep following the instructions on the installation wizard. Click Next.
-
Wait patiently while it installs the files.
-
Another window may pop up. Click next.
-
You are done! Click Close.
Step #2: Install jGRASP - An Integrated Development Environment with Visualizations for Improving Software Comprehensibility
-
Go to this website: jGRASP Download
-
Filling out the survey is optional.
-
Depending on your operating system, download the appropriate executable file.
-
Save the executable file.
-
Open and run the executable file.
-
Follow the instructions on the installation wizard. Click Next.
-
Click I Agree.
-
Click Next.
-
Click Next.
-
Click Next.
-
you can select the type of files which will automatically be opened by jGRASP.
At a minimum, click on the .java jGRASP Java file.
Click Install.
-
You are done! Click Finish.
Step #3: Start a new program in jGRASP
-
Open up the jGRASP program, and go to the 'File' menu -> New -> Java.
Then you will get a new window in the workspace for you to type in your Java Program.
-
When you are ready to compile your code, go to the 'Build' menu and click on 'Compile', which will then attempt to compile your program.
You can also compile by clicking the green '+' icon.
-
If you have not saved your program already, it will prompt you to save the program.
-
Java programs are text files, which end with the ".java" file extension.
The name of the file has to match the name of the class your program.
in this example, the name of the class is "Program" and the name of the file is "Program.java".
-
Error messages, if any, will appear at the bottom of the screen.
if the program compiles successfully, it will create a ".class" file, which contains
Java bytecode, which is used by the computer to execute a program.
-
To run your program, go back to the 'Build' menu, then click 'Run'.
Your program will run in the window at the bottom of the screen in the same window you received any error messages.
It will only run the program if it has compiled properly.
You can also run the program by clicking the red 'running man' icon, next to compile.
Click to validate the HTML code
Click to validate the CSS code