Installing the JDK and Setting the Environment Variables
Installing the Java 2 SDK (or JDK)
If you don’t have the Java 2 SDK(Software Development Kit) or simply JDK installed on your system, Follow these steps to install the JDK on your system:
1. Download the latest Java SDK version from the Oracle official site.
2. Now browse the jdk setup file on your computer and double-click on the setup file to open it. Now follow the on screen instructions to install the JDK on your system. JRE is also installed along with the JDK.
3. You can check if the JDK has been correctly installed or not by looking in the C:\Program Files\Java\. You must see the jdk1.6.0_26 folder and jre1.6.0_26 folder in it. 1.6.0_26 is the version of the jdk and it can be different depending upon which version did you download from the site.
4. Now you have successfully installed the JDK, the next step is to set the Environment Variables for your Java (JDK).
Setting up the Environment Variables
1. Right click on My Computer and click on “Properties”. Then in
the Computer Properties window, on the left panel click on the “Advanced System Settings”, this will open the new “System Properties window.”
2. Go to Advanced tab and right down the window, click on the “Environment Variables”.
3. Now in the Environment Variables box, either you can set the variables for local user or for System variables. Local variables will only work for the current user and the System Variables will work for all the users.
4. Now for creating the variable for System Variables so that all the user can use the jdk, Find the “Path” variable in the list and click on Edit button.
5. Now place the ; followed by the path to the bin folder inside your jdk. For example ";C:\Program Files\Java\jdk1.6.0_07\bin "
6. For local variable, you must create the PATH variable by pressing “New” button and setting its value as " ;C:\Program Files\Java\jdk1.6.0_07\bin; "
7. Now in the local variables, create a New variable “classpath” and set its value to “.” i.e. a single dot.
8. Now you are done and all ready to use the jdk for creating the java applications.
Need for Setting Environment Variables
If you don’t set this variable, you can only access those tools from the bin directory only.
So by setting the classpath variable to “.” ensures that current working directory is included in the list to found the class definition.
Now, as you have set up the environment variables, you are all set to write your first java program.
After that I recommend you to go through the Java Tutorials PDF books one by one and improve your java programming skills.
Once you start gaining confidence, you can test your skills by preparing Core Java Projects listed here with the project synopses.