Time for action – installing JDK and configuring the environment variables
To configure the JAVA_HOME
and PATH
variables, follow these steps:
Installing on a LINUX environment:
- Install JDK 1.7. You can go to the official Java website (www.java.com), download the installer file and then execute it in your operating system. Or you can execute the following commands in a terminal:
shell> sudo add-apt-repository ppa:webupd8team/java shell> sudo apt-get update shell> sudo apt-get install oracle-java7-installer
- Write the following command in the terminal:
shell> sudo gedit /etc/environment
- Add a line in this file that contains the following (or similar, depending on each environment):
JAVA_HOME="/usr/lib/jvm/java-7-oracle"
- To the beginning of the value of the
PATH
variable, add the/usr/lib/jvm/java-7-oracle/bin:
string.Note
The separator for the
PATH
entries in Linux environments is ":"
. - The
/etc/environment
file should look like this: - Restart the session.
In Windows...