Install Java for PC (Windows and some Unix)
Before you start your download:
-For Windows 7:
- On the "Start-menu" right-click on "Computer" and select
"Properties" from the menu that opens.
- On the "Properties" page find the "System type" listed.
This will be either 64-bit or 32-bit OS, and will determine
which Java type you download.
-For other versions of Windows:
-
Follow the instructions here.
To install:
- Go
here.
- In the Java Platform, Standard Edition box, click on
the Download JDK button.
- Click the "Download" button under "Download Java SE
Develepment Kit".
- On the download page under the "Platform" pull-down menu
select "Windows" if you have a 32-bit OS or "Windows x64" if
you have a 64-bit OS. Then click "Continue".
- A download page will pop-up. Click on the
file under "Java SE Development Kit".
- Locate where you downloaded the installation file on
your computer and double-click it to start the
installation.
- Keep clicking "Next" until the installation is
complete.
Setting the Path - Windows
- Right-click the "Computer" icon from the start menu
and select "Properties".
- Go to the "Advanced system setting" option.
- In the window that opens (System Properties - Advanced
tab) click "Environment Variables".
- In the "User variables for <name>" section at the
top, look for the variable "Path" (not PATH).
- If the "Path" variable already exists, click
"Edit". If it doesn't exist, click "New".
"Variable name": Path
"Variable value": Add YOUR_JAVA_BIN_PATH
(should be ;C:\Program Files\Java\jdk1.6.0_21\bin;. )
to the end
(Make sure the path starts with ";"
and ends with ";.")
- In the "System Variables" section, look for the variable
"CLASSPATH".
- If the "CLASSPATH" variable already exists, click
"Edit". If it doesn't exist, click "New".
"Variable name": CLASSPATH
"Variable value": Add ";."
to the end, if it's not already there. If there is no current
value, put just ";."
- Keep clicking "OK" until the "System Properties" window
closes.
- Close all open programs (you might have to restart) for
these changes to take effect.
- Now you should be able to compile programs with just
'javac' and run programs with
'java' without having to be in
the java bin directory.