Many users, especially beginners complain that they are not able to run their java code. Java installation was successful and everything else seems to be fine, still the java code won’t run! This is frustrating.. Many of them, end up quitting to proceed further with Java and Selenium. if you are facing this issue and you landed up to this post, you are right, you just have missed one small pre-requisite. In this quick read post, we will see step by resolution for this.
Basically, once you install JDK on your machine, you get a Successful installation message upon completion. But that’s not it, before proceeding further you need to take the very first step.
The step you are missing post installation is to configure the Java Home. follow the steps below
- Go to computer, right click properties
- Click on “Advanced System Settings”
- Click on” Environment Variable” Button
- Click “New” to add new variable under “System Variable”
- Add Variable Name as “JAVA_HOME”
- Variable Value as path of installation folder for JDK
- Find System Variable as “Path” and click on Edit button
- Click on New button and add below path
(do not change any other value under this)
That’s it! Your Java is configured. Now you can run your programs. Try it.
Just to verify, check java version in command prompt.