Hi,
Here is the way to set up java in your computer and start programming in Java.
Step 1: Download and install Java Platform, Standard Edition or Java SE.
This Java SE Development Kit contains Java Run Time Environments (JRE) also. So you no need to install any additional java software to run java program in your computer.
Step 2: Setting the PATH Environment Variable
Now you have to set path to your installation directory to run java programs from command prompt. The PATH is the system variable that your operating system uses to locate needed executables from the command line or Terminal window. Follow these steps.
1. From the desktop, right click the My Computer icon.
2. Choose Properties from the context menu.
3. Click the Advanced system settings link. After that you'll get the window as shown below.
4. Click Environment Variables. In the section System Variables, search for path and select it.
5. Click Edit and paste the path by separating by a semicolon. See the fig below. Then click OK to close all windows.
The path is the path to jdk bin directory. It may looks like C:\Program Files\Java\jdk1.7.0_10\bin as shown below.
*You may do 1 to 3 steps directly by entering SystemPropertiesAdvan ced in Run!
*If the path is set correctly, you'll get a list of commands when you enter javac in CMD, otherwise an error message! Open Run and enter cmd in it to open CMD
*You can also set path by entering path=your jdk bin directory in command prompt.
Now open command prompt again, compile your java program using the command javac program.java and run it using the command java program
Use CD command to locate directory where your java program is saved.
0 comments:
Post a Comment