Java Software Development Kit (JDK 5.0 Update 14) Installation

Transcription

Java Software Development Kit (JDK 5.0 Update 14) Installation
Java Software Development Kit (JDK 5.0 Update 14) Installation Step
by Step Instructions
1. Click the download link “Download the Java Software Development Kit (JDK 5.0 Update 14) from Sun
Microsystems” available from the Resources tab in the course website
http://www.ecs.umass.edu/ece/ece122/
2. When Sun’s download page, appears, click the download button as shown:
3. Click Download to continue
4. Select your platform as shown. Accept the license agreement and click continue
5. Click on the file name to start downloading.
6. A dialog box opens asking you whether to save the file or not. Click save file
7. Once your file is downloaded, navigate to the directory where you saved the file and double click the file to
begin the installation
8. Installation window appears now. Click next.
9. Click on Accept in the license agreement window
10. Select installation directory. It is recommended to proceed with the default installation directory. Click next.
11. Select NetBeans IDE installation directory (optional). Recommended to proceed with default directories.
12. Make sure you have enough space in your disk. Click next to continue.
13. Installation begins now. As the dialog box says, please be patient !
14. Click Finish to complete setup.
15. Now setup Dr Java in your PC. To get started click on the download link in the resources page of the course
website.
16. Download the correct installable according to your operating system.
17. Save the executable file. Dr Java doesn’t require installation. Just the executable file is sufficient.
18. Once downloaded, click the executable file to run Dr Java
19. You are now all set to run your first Java program. The following screen familiarizes you with Dr Java
Integrated Development Environment (IDE)
20. Let’s try out a sample program now.
21. In the editor window, type the following program:
class HelloWorld
{
public static void main(String args[])
{
System.out.println("Hello ! Welcome to Java !");
}
}
22. Next, save your program, say in your desktop. Click File and Save. Select Desktop from the directory
structure and save your file as shown:
23. Now you are all set to compile your first Java program. Click Compile button. On successful compilation,
you will get a “Compilation completed” message.
24. Alright. Now let’s run our first program. Click Run
25. In case you face any trouble, please feel free to email the TAs and we would be glad to help you out.
APPENDIX
The following PATH variable settings are not required under normal installation
conditions. However you may try the following in case you face any issues installing
Java.
If you are using WindowsXP, follow instructions under XP Path Setting. If you are using Windows Vista, follow
instructions under Vista Path setting
Windows XP Path Variable Setting
1. At the left bottom corner of your computer desktop, choose Start -> Setting -> Control
Panel, and double-click System
2. On Microsoft Windows NT, select the Environment tab; on Microsoft Windows
2000/XP select the Advanced tab and then Environment Variables.
3. For either User variables or System variables, click New and in the popup window, enter
Variable name as CLASSPATH (note that all letters should be capital), and the directory
where your JSDK is installed as the Variable value.
For example:
If your JSDK is installed at: C:\Program Files\Java\jdk1.6.0_04
Put the following line as the value:
C:\Program Files\Java\jdk1.6.0_04\bin; C:\Program Files\Java\jdk1.6.0_04\jre\bin;
The first is where the java compiler 'javac' is, the second is the java run time environment
'java' is, and the final '.' denotes your working directory, so that the compiler and jre will find
where your programs are. To be safe, you may also want to append the above line to then
end of your PATH variable. Use ';' as the separator.
Save the variables, test the setting by opening a DOS prompt, type in
echo %CLASSPATH%
If your environment variables are set correctly, you should see your settings.
Or, you can just type in
javac
java
If your PATH and CLASSPATH is correct, windows should recognize those commands.
You do NOT need to restart your computer when installing Java.
•
Check whether TextPad and Java SDK work on your computer
o Download HelloWorld.java available in the Syllabus section at the class website
into your local drive. Be sure that filename is case sensetive in JAVA
programming.
o Start TextPad, and open this HelloWorld.java file.
o Click menu "Tools" ---> "Compile Java" to compile java file.
o Click menu "Tools" ---> "Run Java Application" to run this file.
If you see "Hello World" in a DOS PROMPT window, that means there is no problem
with your TextPad to compile/run Java program. Congratulations. You can start your
java programming now. If you see some errors when run Java program, please click
here to get more information.
•
For a more comprehensive description on how to setup Java environment on
Windows machinese, please refer to the Sun document at:
http://java.sun.com/j2se/1.4.2/install-windows.html
Windows Vista Path Variable Setting
1. Right click My Computer in desktop and click properties. On the left side, click on
Advanced System Settings. On the system properties window, click on Advanced tab. Click
Environment variables.
2. For either User variables or System variables, click New and in the popup window, enter
Variable name as CLASSPATH (note that all letters should be capital), and the directory
where your JSDK is installed as the Variable value.
For example:
If your JSDK is installed at: C:\Program Files\Java\jdk1.6.0_04
Put the following line as the value:
C:\Program Files\Java\jdk1.6.0_04\bin; C:\Program Files\Java\jdk1.6.0_04\jre\bin;
The first is where the java compiler 'javac' is, the second is the java run time environment
'java' is, and the final '.' denotes your working directory, so that the compiler and jre will find
where your programs are. To be safe, you may also want to append the above line to then
end of your PATH variable. Use ';' as the separator.
Save the variables, test the setting by opening a DOS prompt, type in
echo %CLASSPATH%
If your environment variables are set correctly, you should see your settings.
Or, you can just type in
javac
java
If your PATH and CLASSPATH is correct, windows should recognize those commands.
You do NOT need to restart your computer when installing Java.
•
Check whether TextPad and Java SDK work on your computer
o Download HelloWorld.java available in the Syllabus section at the class website
into your local drive. Be sure that filename is case sensetive in JAVA
programming.
o Start TextPad, and open this HelloWorld.java file.
o Click menu "Tools" ---> "Compile Java" to compile java file.
o Click menu "Tools" ---> "Run Java Application" to run this file.
If you see "Hello World" in a DOS PROMPT window, that means there is no problem
with your TextPad to compile/run Java program. Congratulations. You can start your
java programming now. If you see some errors when run Java program, please click
here to get more information.
•
For a more comprehensive description on how to setup Java environment on
Windows machinese, please refer to the Sun document at:
http://java.sun.com/j2se/1.4.2/install-windows.html