In the previous post i have mentioned about the software and hardware requirements to get started with java programming. Only having those requirements is not enough. We need to set path of the JDK as the environment variables. There are two ways for doing this.
Process 1
We can set the path from the command prompt. The steps are mentioned below.- Open the command prompt.
- Type javac and press enter.
- If the result is shown as the command is not recognized, that means path is not set. Or if some help commands are shown then path is already set.
- To set path first you need to copy the location of jdk installed in your drive.
- Goto c:\program files and find java folder. Inside the java folder search for folder with jdk and its version. Inside it goto bin folder. And click on any file and view properties and there copy the path. It looks like this "C:\Program Files\Java\jdk1.5.0_09\bin" . Copy it.
- In the command prompt, type "set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin" without the double quotes. The path is only sample example. It may vary according to the JDK version.
- Now to check whether the path is set correctly or not, type javac and press enter. Now the results are shown instead of showing error. Now you can run the java program.
Process 2
- Goto the windows properties.
- Click on advanced system setting.
- Click the environment variables.
- In the system variables, click on add new.
- Then enter "PATH" in variable name and in the variable value enter the path that is copied as in process 1.
- To check do as in process 1.
No comments:
Post a Comment