Check to see if your Ubuntu Linux operating system architecture are 32-bit or 64-bit, open up a terminal and run the follow ing command below.
Uname-a or File/sbin/init
Linux caochu-inspiron-n5110 3.13.0-32-generic #57-ubuntu SMP Tue Jul 03:51:08 UTC x86_64 x86_64 x86_64 gnu/linux
Check If you have the Java installed on your system. To does this, you'll have a to run with the Java version command from terminal.
Type/copy/paste:java-versio
If you have OpenJDK installed on your system, you have the wrong vendor version of Java installed for this exercise.
sudo apt-get purge openjdk-*
Download the Oracle Java JDK for Linux.
Unpack the compressed Java binaries, in the DIRECTORY/USR/LOCAL/JAVA8
Scroll down to the end of the file using your arrow keys and add the following lines below to the end of Your./etc/profile File
Export java_home=/usr/local/java8/jdk1.8.0_73 Export JRE_HOME=${JAVA_HOME}/JRE export classpath=.:${java_home}/lib: ${jre_home}/lib Export Path=${java_home}/bin: $PATH
Source/etc/profile
Configure Default JDK version:
sudo update-alternatives--install/usr/bin/java Java/usr/local/java8/jdk1.8.0_73/bin/java 300
sudo update-alternatives--install/usr/bin/javac Javac/usr/local/java8/jdk1.8.0_73/bin/javac 300
sudo update-alternatives--install/usr/bin/jar Jar/usr/local/java8/jdk1.8.0_73/bin/jar 300
sudo update-alternatives--install/usr/bin/javah javah/usr/local/java8/jdk1.8.0_73/bin/javah 300
sudo update-alternatives--install/usr/bin/javap JAVAP/USR/LOCAL/JAVA8/JDK1.8.0_73/BIN/JAVAP 300
sudo update-alternatives--config java
Test
Java-version
This article is from the "Mr_computer" blog, make sure to keep this source http://caochun.blog.51cto.com/4497308/1759494
Ubuntu--how to Install Oracle Java JDK8