foralobo foralobo - 4 months ago 15
Java Question

Installing Java 7 on Ubuntu

to install java I have always used the classic way from the terminal.
I would like to install java manually.
I placed the folder of the JDK on the desk and I set environment variables (PATH, CLASSPATH and JAVA_HOME).
From the terminal, if I type

java -version
I get printed

foralobo@ubuntu-vincy:~$ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)


But when I try to install eclipse or netbeans, the system warns by saying that there is no java installed on the machine.

What is missing to compleatare manual installation?
(Ubuntu 13.04)

Answer

Using Oracle Java 7 is not formally supported by Ubuntu. There's plenty solutions for installing it, listed on https://help.ubuntu.com/community/Java .

The simplest one listed is this one:

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

It'll keep your java 7 installation up to date.

To automatically set up the Java 7 environment variables JAVA_HOME and PATH:

sudo apt-get install oracle-java7-set-default
Comments