I got a new laptop with Windows 10 and I want to set it up so I can use java
and javac
from the command line.
I have searched online but all the guides are for previous versions, and I don't want to mess around with something I don't understand.
Give the new system variable the name JAVA_HOME and the value C:\Program Files\Java\jdk1. 7.0_79 (depending on your JDK installation path it varies). Then select the Path system variable and click Edit.... Keep the variable name as Path , and append C:\Program Files\Java\jdk1.
Java does not need any environment variables to be set. However, setting some environment variables makes some things easier. PATH If the jre/bin folder is on the path, you don't have to qualify to run the java command. If the jdk/bin folder is on the path, you don't have to qualify to run the java and javac commands.
Just set the path variable to JDK bin in environment variables.
Variable Name : PATH
Variable Value : C:\Program Files\Java\jdk1.8.0_31\bin
But the best practice is to set JAVA_HOME and PATH as follow.
Variable Name : JAVA_HOME
Variable Value : C:\Program Files\Java\jdk1.8.0_31
Variable Name : PATH
Variable Value : %JAVA_HOME%\bin
Here are the typical steps to set JAVA_HOME on Windows 10.
You can find complete tutorials on my blog :
How to set JAVA_HOME in 64 bit Windows 10 OS
To find the env vars dialog in Windows 10:
Right Click Start
>> Click Control Panel (Or you may have System in the list)
>> Click System
>> Click Advanced system settings
>> Go to the Advanced Tab
>> Click the "Environment Variables..." button at the bottom of that dialog page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With