2

I tried java -version, but it returned something like:

java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.14.04.1)
OpenJDK Zero VM (build 24.95-b01, mixed mode)

According to the program I am trying to start, it requires Oracle(R) Java(TM) Runtime Environment 7 or 8.

inf3rno
  • 252
  • 2
    The number after the 1. In this case, you're on JRE 7. If it really needs the Oracle JRE, see http://askubuntu.com/q/56104/158442 – muru Feb 16 '16 at 23:26

1 Answers1

3

You need Oracle Java which you can install like this

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

and then setup like this

sudo apt-get install oracle-java8-set-default

Right now you have OpenJDK and as per your question you need Oracle Java. In case the JAVA_HOME is not setup properly you can do:

sudo vi /etc/environment
export JAVA_HOME=/path-to-java-before-bin-dir
source /etc/environment
Ashu
  • 3,966
  • Should I remove the old java? I don't want it to interfere with the new one, and the system is low on memory. Will it have any effect on the Ubuntu if I remove it? – inf3rno Feb 17 '16 at 00:36
  • @inf3rno. No you don't have to. The steps that i have provided doesn't purge openJDK. It's just make sure that you get Oracle Java 8 from the right PPA(so that you get future updates and bug fixes) and then it will make sure that it's Oracle Java 8 is invoked when you issue java(provided you setup path properly). If this solves your problem - mark this as answer(tick mark) – Ashu Feb 17 '16 at 00:50
  • Thanks! I'll purge it, I guess programs which used that version are compatible with the oracle version. – inf3rno Feb 17 '16 at 03:13