The first step for starting java programming is to prepare you computer for compiling and running a java source code. You need to download the jdk (java development kit) for compiling and running a java program in your computer.
For downloading jdk just go to the following link. Download jdk
After the successful installation of jdk just open up the windows directory and open up the program files. Open the folder named java in it, you can see that there are two types of folders are present with names jdk and jre.
Steps for setting the environment variable for java
1. Open the jdk folder then open the bin folder in it and copy that path from the address bar.
2. Now open the system property and got to the advanced system settings.
3. Click the environment variable button in that window.
4. Now click the edit button on the window that appear next.
5. Set variable name as path and paste the java compiler path (program files--->java-->jdk--->bin) as variable value
After doing all the above steps, you are successfully setup the java environment variable path in your computer. Now your computer is ready for compiling a java code. For checking weather the setup is success or not, just open up the command prompt and type javac. If the setup process is a successive one then you can see all the directory of your java compiler, other wise the command prompt print the message "javac is not recognized as an internal or external command".
Alternate way for setting up the java environment variable.
Here is an alternate way for setting up your java environment variable. Suppose if you want to compile a java program saved in "D" drive of your computer, then you can setup the java variable path for D drive by typing following command on the command prompt of your computer.
path = "C:\Program Files \Java\jdk1.7.0\bin";
This is better method than the previous one, because it will not affects any other system variables. One of the disadvantage of this method is that, the variable path automatically resets when you close the command prompt window.
CLICK HERE FOR VIDEO TUTORIAL OF THIS TOPIC
After the successful installation of jdk just open up the windows directory and open up the program files. Open the folder named java in it, you can see that there are two types of folders are present with names jdk and jre.
Steps for setting the environment variable for java
1. Open the jdk folder then open the bin folder in it and copy that path from the address bar.
2. Now open the system property and got to the advanced system settings.
3. Click the environment variable button in that window.
4. Now click the edit button on the window that appear next.
5. Set variable name as path and paste the java compiler path (program files--->java-->jdk--->bin) as variable value
Alternate way for setting up the java environment variable.
Here is an alternate way for setting up your java environment variable. Suppose if you want to compile a java program saved in "D" drive of your computer, then you can setup the java variable path for D drive by typing following command on the command prompt of your computer.
path = "C:\Program Files \Java\jdk1.7.0\bin";
This is better method than the previous one, because it will not affects any other system variables. One of the disadvantage of this method is that, the variable path automatically resets when you close the command prompt window.
CLICK HERE FOR VIDEO TUTORIAL OF THIS TOPIC
Comments
Post a Comment