Setup Java Environment Variables: Automation Testing Hub
Setup Java Environment Variables: Automation Testing Hub
Trouble setting up your browser with Selenium? Try our Selenium Setup Guide
This article provides you with detailed steps to setup Java environment
variables mainly JAVA_HOME and PATH variables. These
environment variables point to the folder location where Java is
installed. These environment variables are mainly required by some
external programs and tools to figure out where Java is installed on
your machine.
1 of 10 9/5/17, 7:10 PM
Setup Java Environment Variables - Automation... http://www.automationtestinghub.com/setup-jav...
Update [23 Aug, 2017]: The screenshots in this article refer to Java 8
version 121 (i.e. jdk1.8.0_121). But the steps work fine with the latest
version of Java as well. So please use the exact steps as given below
with the version of Java that you have installed on your machine.
2. Now open the JDK folder. If you have multiple JDK folders, then open
the one which represents the latest version, and copy the folder
2 of 10 9/5/17, 7:10 PM
Setup Java Environment Variables - Automation... http://www.automationtestinghub.com/setup-jav...
3 of 10 9/5/17, 7:10 PM
Setup Java Environment Variables - Automation... http://www.automationtestinghub.com/setup-jav...
4 of 10 9/5/17, 7:10 PM
Setup Java Environment Variables - Automation... http://www.automationtestinghub.com/setup-jav...
8. Click on OK button. You will see that JAVA_HOME variable has now
5 of 10 9/5/17, 7:10 PM
Setup Java Environment Variables - Automation... http://www.automationtestinghub.com/setup-jav...
If you already have JAVA_HOME previously set, then you can click on
Edit button to modify its value. You have now successfully setup
JAVA_HOME variable. Let us now check how to setup the Path variable.
1. Open your latest JDK folder and check that it has bin folder in it
6 of 10 9/5/17, 7:10 PM
Setup Java Environment Variables - Automation... http://www.automationtestinghub.com/setup-jav...
7 of 10 9/5/17, 7:10 PM
Setup Java Environment Variables - Automation... http://www.automationtestinghub.com/setup-jav...
5. Select the Path variable and click on Edit button. Path variable
window would be opened
6. Move over to the end of Variable value text field. There would be
already some value there. Put a semi-colon (;) at the end and then
add add the JDK folder location %JAVA_HOME%\bin,as shown
below (Semi-colon is a delimiter which is used to dierentiate between
dierent values in Path variable)
7. Click on Ok button. bin folder location would now have been added
in the Path variable
8 of 10 9/5/17, 7:10 PM
Setup Java Environment Variables - Automation... http://www.automationtestinghub.com/setup-jav...
Aer you have set JAVA_HOME and Path variables, its time to check if
the variables are set correctly. Follow the steps given below to check
this
2. Run the command javac -version. This should show the javac
version number. Verify that this version number is same as the latest
JDK version (from JDK folder name). You can also run the command
where javac. This command should show the JDK bin folder location.
This should be the same folder location that you had set in the Path
variable
Both these commands verify that JAVA_HOME and Path variables have
been setup correctly. With this, we complete our section of Java
download, install and setup. We are now ready to jump over to the next
article, which is, installing Android SDK.
9 of 10 9/5/17, 7:10 PM
Setup Java Environment Variables - Automation... http://www.automationtestinghub.com/setup-jav...
Name
First Appium Test Script to Launch App on Install additional Android SDK tools
Real Device 2 comments 5 months ago
21 comments 4 months ago anish Hi Manik,Apologies for the confusion.
anish Hi Manoujitha,Thank you for the The 4th point was there but it somehow got
feedback. We are really happy that you found this commented, and hence was not visible. I have re-
guide useful.I'm working on other articles as well.
Create new project for Appium in Eclipse Selenium 3.4 Complete Guide to the latest
2 comments 5 months ago Selenium WebDriver
Anish Pillai Hi Manoujitha,Thank you for the 8 comments 5 months ago
feedback. Glad that you found the guide Debanjan Selenium Great article for Selenium
useful.Regarding your query, Appium can be 3.4.0 but one wrong information, "You would need
to use GeckoDriver if you want to run your scripts
10 of 10 9/5/17, 7:10 PM