How to install JDK 8 in Ubuntu 14

Опубликовано: 12 Апрель 2026
на канале: Krishna Soma
29,797
102

Here i'm going to show, How to install JDK 8(latest) in Linux 14 from tar file

1. Download JDK8 tar file from java website

2. Extract downloaded tar file in terminal with following command

tar -xzf filename

3. After 2nd step move extracted JDK folder to /usr/local, to do this we need to execute following as superuser(SU)

sudo filename /usr/local/

4. Now we need to update java alternatives. Run following commands in terminal

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/jdk1.8.0_45/bin/java" 1

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/jdk1.8.0_45/bin/javac" 1

sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/jdk1.8.0_45/bin/javaws" 1

If JPS is not working( If JPS present in jdk/bin directory) run following command

sudo update-alternatives --install "/usr/bin/jps" "jps" "/usr/local/jdk1.8.0_45/bin/jps" 1

5. At last, but not least we need to update JAVA_HOME location in .bashrc file

6. Open .bashrc file by following command

vi .bashrc or vim .bashrc or gedit .bashrc

7. Add JAVA location like below

#JAVA_HOME setup

export JAVA_HOME="/usr/local/jdk1.8.0_45"
set PATH="$PATH:$JAVA_HOME/bin"

export PATH

8. That's it. Now check java installed or not by following comand
java -version

For more www.windowsfreak.com
Find us on Facebook: www.facebook.com/windowsfreakdotcom