Post Installation Setup
-
5. Updating
Finally, Update System Java to Oracle JDK 8
Run All these Commands below:sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8*/bin/java 1065
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8*/bin/javac 1065
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.8*/bin/jar 1065
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8*/bin/javaws 1065
Then to Check or Set the System Java Version in Use do:
sudo update-alternatives --config java
To Switch of Java Version Just Enter the Selection Number on First, Column. :)
-
6. Setting Up JAVA_HOME
Finally, to Set Up JAVA_HOME User Environment Variable (Optional)
And Edit the User’s Bash environment Configuration file:nano $HOME/.bashrc
And Append:
export JAVA_HOME=/usr/lib/jvm/jdk1.8[uX]
Replace the [uX] Looking for the Installed Java 8 Version with:
ls /usr/lib/jvm/ | grep jdk1.8
Ctr+x to Save & Exit from nano Editor :)
To Load New Bash Config simply:bash
Contents