Set Up Your Java Home Path in Ubuntu
Template:CopyeditbotThis short article will explain how to set your JAVA_HOME Environment path in your /etc/bash.basrc profile. Many Applications today look for the JAVA_HOME path, in order to function correctly.
Contents
Steps
- Launch the Terminal and sudo su to root.
- Identify where is Java installed on your Ubuntu Machine by typing
which java
. - Now to set the JAVA_HOME globally, we edit the bash.bashrc file.
- At the end of the file type the following, one line at a time.
- Line 1. JAVA_HOME=/usr/lib/jvm/default-java/bin .
- Line 2. export JAVA_HOME
- Line 3. PATH=$PATH:$JAVA_HOME
- Line 4. export PATH
. - Close the Terminal and re-open it and issue the command
. You should get the new path.echo $JAVA_HOME
- Type java -version , to see the version of Java installed.
Warnings
- Do not type the path of the
commandwhich java
- Instead , type this
JAVA_HOME=/usr/lib/jvm/default-java
Related Articles
- Install Software in Ubuntu
- Install Ubuntu on VirtualBox
- Organize Photos on Linux
- Change the Timezone in Linux
- Install Linux
- Create an ISO File in Linux