I've installed the official Oracle Java on my Ubuntu machine. For that I did the following:

  1. Download the latest JRE for x64 (.tar.gz)
  2. Unpacked this archive on my Windows machine
  3. Uploaded the folder jre_1.7.0 to my Ubuntu machine (via FTP)
  4. Used update-alternatives --install and update-alternatives --set to install Java

When I tried java -version, Ubuntu said permission denied. So I manually added the execution permission (chmod) to all files in jre_1.7.0/bin. Then, java -version worked:

java version "1.7.0_15"
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

For installing Openfire (XMPP Server), which did not work, I tried the following:

  1. Download the latest .deb package
  2. Install it via sudo dpkg -i openfire_3.8.0_all.deb

This failed due to the following dependency problem:

dpkg: regarding openfire_3.8.0_all.deb containing openfire, pre-dependency problem:
 openfire pre-depends on sun-java5-jre | sun-java6-jre | default-jre-headless | openjdk-6-jre
  sun-java5-jre is not installed.
  sun-java6-jre is not installed.
  default-jre-headless is not installed.
  openjdk-6-jre is not installed but configs remain.
dpkg: error processing openfire_3.8.0_all.deb (--install):
 pre-dependency problem - not installing openfire

Why doesn't it find Java? What am I doing wrong? Thanks in advance!


If you install a program from source or from a tarball as you did with java, the package management system doesn't know that it's installed. This is why it's giving you an error.

The best way to install Oracle Java in Ubuntu, in my experience is using the WebUpd8 PPa. You can find how to add it in this link. But to summarize:

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

As a bonus this will keep your java version updated.

  • Thank you :) Great that it manages the updates as well. Had to install python-software-properties for that, by the way, if others try to do this as well. – caw Feb 21 '13 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.