Process to install Java in Ubuntu or any Linux based Systems:
- Open Terminal from Application Dash or press Ctrl+Alt+T
- Update repository:
sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update
- Run the following command in the Terminal:
sudo apt-get install openjdk-8-jdk sudo apt-get install openjdk-8-source #this is optional, the jdk source code
- Type command line as below...
apt-cache search jdk
(Note: openjdk-8-jdk is symbolically represented here. You can choose the JDK version according to your requirements) - For "JAVA_HOME" (Environment Variable) type command as shown below, in "Terminal" using your installation path...
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
(Note: "/ usr / lib / jvm / java-8-openjdk" is for demonstration purposes only and you should use your path based on your installation.) - For "PATH" (Environment Variable) type command as shown below, in "Terminal" using your installation path...
export PATH=$PATH:/usr/lib/jvm/java-8-openjdk/bin
(Note: "/ usr / lib / jvm / java-8-openjdk" is for demonstration purposes only and you should use your path based on your installation.) - Check for "open jdk" installation, just type command in "Terminal" as shown below
javac -version
Comments
Post a Comment