You can download the latest version of jdk from http://java.sun.com/javase/downloads/index.jsp.
Once you download the exe file you can now install it.
To install the jdk, double click on the downloaded exe file.
Step 1. Double Click the icon of downloaded exe.
Step 2: Now a "License Agreement" window opens.
Just read the agreement and click "Accept" button to accept and go
further.
Step 3: Now a "Custom Setup" window
opens.
Clicking the "OK" button starts the installation. It is shown in the following figure.
Step 5: Next window asks to install Runtime Environment.
Step 6: Click on ‘Next’ and then "OK" button starts the installation.
Step 7: Now "Complete" window appears indicating that installation of jdk 1.6 has completed successfully. Click "Finish" button to exit from the installation process.
Step 8: The above installation will create two folders according to version number of java.for example "jdk1.6.0_01" and "jre1.6.0_01" in "C:\ Program Files\ java" folder.
Step 9: To make available Java Compiler and Runtime Environment for compiling and running java programs , we set the system environment variables.
First of all select "My Computer" icon and right click the mouse button. Now click on "system Properties" option. It provides the "System Properties" window , click the 'Advanced' tab. Then Click the "Environment Variables" button. It provides "Environment Variables" window. Now select the path in System variables and click 'Edit' button. The"Edit System Variable" window will open. Add "c:\Program Files\Java\jdk1.6.0_01\bin" to 'variable value' and click 'Ok', 'Ok' and 'Ok' buttons.
Step 10: Now set the JAVA_HOME variable and set its value to " C:\Program Files\Java\jdk1.6.0_01 ". If this variable has not been declared earlier then create a new system variable by clicking on "New" button and give variable name as "JAVA_HOME" and variable value as " C:\Program Files\Java\jdk1.6.0_01 ". Now click "OK". This variable is used by other applications to find jdk installation directory. For example, Tomcat server needs "JAVA_HOME" variable to find the installation directory of jdk.
Step 11: Now this is the final step to check that you have installed jdk successfully and it is working fine. Just go to the command prompt and type javac and hit enter key you will get the screen with java commands.
Now you can create, compile and run java programs.
Now you can create, compile and run java programs.
Jdk folder structure:
After installation one folder will be created with name ‘java’. In that jdk folder will be like below.
/jdk
The root directory of the JDK software installation. Contains copyright, license, and README files. Also contains src.jar, the archive of source code for the Java 2 platform.
/jdk/bin
The executables for all the development tools contained in the Java 2 JDK. The PATH environment variable should contain an entry for this directory. For more information on the tools, see the JDK Tools.
/jdk/lib
Files used by the development tools. Includes tools.jar, which contains non-core classes for support of the tools and utilities in the JDK. Also includes dt.jar, the Design Time archive of BeanInfo files that tell interactive development environments (IDE's) how to display the Java components and how to let the developer customize them for the application.
/jdk/jre
The root directory of the Java runtime environment used by the JDK development tools. The runtime environment is an implementation of the Java 2 platform. This is the directory referred to by the java.home system property.
/jdk/jre/bin
Executable files for tools and libraries used by the Java platform. The executable files are identical to files in /jdk1.5.0/bin. The java launcher tool serves as an application launcher, in place of the old jre tool that shipped with 1.1 versions of the JDK software. This directory does not need to be in the PATH environment variable.
/jdk/jre/lib
Code libraries, property settings, and resource files used by the Java runtime environment. Includes:
rt.jar -- the bootstrap classes (the RunTime classes that comprise the Java platform's core API).
charsets.jar -- character-conversion classes.
Aside from the ext subdirectory (described below) there are several additional resource subdirectories not described here.
/jdk/jre/lib/ext
Default installation directory for Extensions to the Java platform. This is where the JavaHelp jar file goes when it is installed, for example.
localedata.jar -- locale data for java.text and java.util.
/jdk/jre/lib/security
Contains files used for security management. These include the security policy (java.policy) and security properties (java.security) files.
/jdk/jre/lib/i386/client
Contains the .so file used by the Java HotSpot Client Virtual Machine, which is implemented with Java HotSpotTM technology. This is the default VM.
/jdk/jre/lib/i386/server
Contains the .so file used by the Java HotSpot Server Virtual Machine.
/jdk/jre/lib/applet
Jar files containing support classes for applets can be placed in the lib/applet/ directory. This reduces startup time for large applets by allowing applet classes to be pre-loaded from teh local file system by the applet class loader, providing the same protections as if they had been downloaded over the net.
/jdk/jre/lib/fonts: Font files for use by platform.
No comments:
Post a Comment