"The author of this post has edited and moved this material to the Java Community Help Wiki at https://help.ubuntu.com/community/Java
This post will no longer be monitored by the author, who asks that you refer to the Wiki and create new posts in the appropriate forum if you need further assistance."
Since so many people ask and I answer so many times, I figured maybe I could make a single post I can direct people to so I don't have to repeat this so often.
Maybe it will be useful for others to direct posters to.
How do I install Java?
Well, if possible, your first choice should be OpenJDK 7 because it is open source. That can be installed easily from the repo using apt, aptitude, the Software Center of Synaptic as you choose.
Unfortunately, that may not be good for you. Although OpenJDK 7 is the reference implementation for Java 7, much of the world does not recognize OpenJDK as Java. It's an odd state of affairs, but it is what it is. (Fortunately, both Oracle Java and OpenJDK can exist on the same machine without problems and you can switch easily between the JREs as you care to. Swapping the browser plugins may be a bit of a challenge.)
Java used to be available in the repos of most major distros when Sun was Sun and Java was Sun Java. But The Ravenous Monstoracle ate Sun and now it's Oracle Java. Now Oracle has decided to nullify any license allowing distros to maintain Java in their repos. We can't install from our friendly neighborhood repo any more.
All of the Java 6 installation tutorials all over the web are about to be useless, since Java 6 is reaching end of life.
But happy days are here again thanks to the folks at webupd8.org. They created a package that installs Java 7 for you, installs the browser plug-in and even updates Java as Oracle releases them. They don't have Java in a repo, but rather a script that downloads the package from Oracle and does all that magic for you.
Please, for reference, have a look here since these guys deserve the credit for this:
webupd8
and here, while you're at it:
webupd8
Just because I know most of us are simply too lazy/busy/in-a-hurry to go to something silly like a website by the people who provide something, I'm going to lay it out here in all of its difficult detail.
In the terminal:
1. Add webupd8's PPA to your sources.list
- or, if you don't mind adding several other packages -Code:sudo add-apt-repository ppa:webupd8team/java
(you may substitute xubuntu-restricted-extras, kubuntu-restricted-extras, etc). This won't install anything. It will just make some interesting things available -- one of which is webupd8's Java installer.Code:sudo apt-get install ubuntu-restricted-extras
2. Update
3. InstallCode:sudo apt-get update
4. To update your Java alternatives:Code:sudo apt-get install oracle-java7-installer
and choose from a list that will look something like this (the details may differ for you):Code:sudo update-alternatives --config java
I know that was a lot to do, but I think we can all struggle through it.Code:There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ———————————————————— * 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode 1 /usr/lib/jvm/jre1.7.0/jre/bin/java 3 manual mode Press enter to keep the current choice[*], or type selection number: 1
If you ever want to get rid of Oracle Java, it's even harder:
If you find this useful, please contact webupd8.org and let them know you appreciate their work.Code:sudo apt-get remove oracle-java7-installer
Please also note that the following well-written tutorial has been updated for Oracle Java 7, if you ONLY want the JRE and not the JDK as well, here: Easy Linux Tips



Adv Reply








Bookmarks