Java software for your computer, or the Java Runtime Environment, is also referred to as the Java Runtime, Runtime Environment, Runtime, JRE, Java Virtual Machine, Virtual Machine, Java VM, JVM, VM, Java plug-in, Java plugin, Java add-on or Java download.

Lab1: Installing and Running Java Programs Lab1: Installing and Running Java Programs Description This lab has two parts. First, you will step through the process of installing the software necessary to write, compile, and run Java programs. Second, you will step through the process of writing, compiling, and running a Java program.

Pre-Lab - Downloading Software Downloading Java (PC only - Mac is already installed) 1. Go to, choose 'JDK 6 update 7,' click the download button, and then choose 'Windows Offline Installation, Multi-Language.'

If you have a 64-bit computer, you need to choose 'Windows x64 executable.' If you have something older than Microsoft Vista, go to and download the Java-based installer. Step 1: Installing Software If you do not own a laptop or did not bring yours, then skip step 1. You may team up with someone who has a laptop that is the same type as yours (PC vs Mac) so that you can see it done before you attempt it at home. Note: In subsequent labs, you will need to show the TA your completed pre-lab to get credit for attending lab.

Installing Java (PC only - Mac is already installed) 1. Make sure you downloaded the software in the pre-lab step. Double-click on the downloaded file and proceed to install the software. Make note of where the software is installed. Set your 'Environment Variables.' This is the hardest part, so get help from the TA if you run into trouble. If you are using Windows XP or older, then right-click on 'My Computer' and choose 'System Properties.'

Then click on the 'Advanced' tab. Then press the 'Environment Variables' button. There are two variables you need to add. First, in the 'System variables' section, scroll down and find the variable named 'Path.' Click on it and then press the button 'Edit'.

You put the path of where the jdk was installed to the end of the path. First place a semi-colon. Then place the path. For example, I had to add: ';C: Program Files Java jdk1.6.0_07 bin' - make sure you are just adding it, not erasing what was already there. Now, look at the 'User variables' section. If there is a Path variable, add the same thing to path.

Otherwise, click the 'New' button. Name the new variable 'Path' and put in the same thing without the first semi-colon. Finally, click 'OK' and exit the 'System Properties' window. The way you get to the system properties is slightly different for Vista, but it is very similar.

If you can't find it, ask the TA. Installing an Editor (PC and Mac) 1.

Download software (in pre-lab step) 2. Run the installer. If it does not work, you may not have set your paths properly for your JDK. Ask the TA for help. Step 2: Writing, Compiling, and Running a Java Program Writing a program in jEdit 1.

Make a directory for your 5J homework. Copy and paste the code found into your editor.

Save the file with the name 'HelloWorld.java' into your new 5J homework directory. Compiling a program on a PC 1. Open a command prompt by clicking on start and then the 'Run' button 2. Type 'cmd' into the dialog box and click 'OK' 3. Figure out the path for your new 5J homework directory. When looking at a finder window, it is the field labeled 'address' near the top of the window. For example, my 5J homework directory is: 'C: Documents and Settings Panasonic Desktop 5J' 4.

Type 'cd path.' For example, I would type 'cd C: Documents and Settings Panasonic Desktop 5J' 5. Type 'dir' and verify that the file you created, HelloWorld.java, is in the directory.

Pc For Mac For Java

Now compile the program by typing 'javac HelloWorld.java'. If it says nothing, then it compiled successfully. Compiling a program on a Mac 1. Open a command prompt by double-clicking on 'Terminal,' which is located in Applications/Utilities 2. Now navigate to your new 5J homework directory. Type 'ls' to list the directories. Find the directory under which you placed your homework directory.

Type 'cd directory.' Directory might be Desktop, Documents, or the 5J homework directory. Sale Repeat steps 2 and 3 until you are in your 5J homework directory. If you go into the wrong directory and want to back out of it, then type 'cd.' Type 'ls' and verify that the file you created, HelloWorld.java, is in the directory. Now compile the program by typing 'javac HelloWorld.java'.

If it says nothing, then it compiled successfully. Running a program 1. Type 'java HelloWorld' 2.

Show your TA, and you are finished for today.

News, Technical discussions, research papers and assorted things of interest related to the Java programming language NO programming help, NO learning Java related questions! These have separate subreddits - see below.