Currently im learning java and want set a java path in environment variables. How to set java path and class path in windows 10 laptop ? do we get errors while set java path and java_home in windows 10 ? Can anyone show a easy step by step procedure to set java execution environment,where i can use java on my computer. Image help would be really helpful.
Share
Shweta Ranjan
Here I am enlisting few steps to set javapath and Classpath in windows 10
Open Advanced System Settings
In windows 10 we need to press Windows Key + Pause Key.
Change settings and select Advanced tab.
or
Press Windows Key and click on the search box .
1. Search advanced system settings
2. Click on the View advanced system settings
Set JAVA_HOME Environment variable
Click on System Settings below box will appear
Move forward with Advanced tab, click on ‘Environment Variables’.
Click the “New” button Under “System variables” and enter JAVA_HOME as “Variable name” and the path to your Java JDK directory under “Variable value”
In ‘System Variables’ click on the ‘New’ Button and type JAVA_HOME in field ‘Variable name:’ and type in the path of JDK in ‘Variable value:’.
Add the path as System Variable.
Update System PATH
1. In the Environment Variables window under System variables click on the path.
2. Click Edit.
3. In the Edit environment variable window click New.
4. Then type in the following%JAVA_HOME%bin .
Click on OK.
Test your configuration
Run Command Prompt
1. Type in the following echo %JAVA_HOME%
This will echo the directory path of JAVA_HOME or it will echo nothing if Variable is not set.
echo %JAVA_HOME%
Output:
C:Program FilesJavajdk1.8.0_191
To check version type java -version:
1. Type following in command line tool
java -version
This will print out the version of Java as in my case:
java version “1.8.0_191”
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191, mixed mode)
Further if you are facing java error you can read this article to gets the solution