Is it ok to install Java 7 in Ubuntu 12.04?

Solution 1:

  • Yes, it's perfectly OK to install Java 7 on Ubuntu. In fact, you can install and use multiple versions of Java, from multiple vendors, at the same time!

  • The reasons some don't recommend Java 7 as a replacement for Java 6 yet, for end-users, include:

    • Java 7 is still relatively new and "maturing"
    • Most of the Java apps/code out there was written for Java 6 and works perfectly with it
    • Java 7 should be able to run the above too, but rarely there's a bug and it fails or causes problems.
  • As this link from May 2012 explains, while Java 7 has been available for developers since mid-2011, Oracle only started upgrading Windows users to Java 7 in May 2012, and it is still offering and recommending Java 6 to Linux and Mac users.

  • Bottom-line: if you are a developer, get Java 7. If you are a user, you can get it too but keep Java 6 around. This question explains how you can install multiple Java versions and use a graphical utility to chose which is the "default" Java

Solution 2:

Java 7 work great. I've been running it for at least 2 months, and no problems. To install Oracle Sun Java, Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
  • Are PPA's safe to add to my system and what are some "red flags" to watch out for?

For Open JDK

sudo apt-get install openjdk-7-jre

Or from Ubuntu Software Center