Showing posts with label JDK. Show all posts
Showing posts with label JDK. Show all posts

Wednesday, September 26, 2012

[HOW TO] Install Oracle JDK 7 Manually in Ubuntu

The Java Development Kit (JDK) is mainly a set of tools for running, compiling and debugging Java applications.

There are a few other JDK, but in this article we'll see how to manually install the Oracle's JDK in any distribution from the Ubuntu family. The process consists of downloading the binary package, extract it and update the system so that the new version is used. By the way, if you installed the JDK via PPA, as described in my previous article, both can work alongside. The command update-alternatives can be used to choose one between them.

Download

The first step is to download the latest binaries package from Oracle's website. On the downloads webpage choose the JDK download button.

On the next page you'll see list of several files, but you should focus your attention on two: The file name ends with i586.tar.gz or x86_64.tar.gz. If your system is 32 bits you should select the first one and select the latter if it's 64 bits. If you're unsure, run the command uname -m on a terminal window. Now download the file you need and take note of its download location.

Install

We've downloaded the package, so now we must install it.

Start by opening a terminal window and changing the current directory, using cd command, to the download destination.

Then extract the package:

sudo tar -zxvf jdk*.tar.gz -C /usr/lib/jvm/

Add the new java alternative to the system:

for alt in java javac; do sudo update-alternatives --install /usr/bin/$alt $alt /usr/lib/jvm/jdk*/bin/$alt 1000; done

Finally, update the java alternatives, typing the selection number of the last choice presented by the command bellow. You'll be prompted twice, once for java and another time for javac.

for alt in java javac; do sudo update-alternatives --config $alt; done

Uninstall

If you want to remove Oracle's JDK, here's how to proceed: Choose another alternative for java and javac, then just remove the JDK directory.

for alt in java javac; do sudo update-alternatives --config $alt; done && sudo rm -rf /usr/lib/jvm/jdk1.7*

Friday, May 4, 2012

Install OpenJDK 7 in [X]ubuntu 12.04/12.10

OpenJDK is the official Ubuntu supported solution for running and compiling Java programs. In this solution separated packages are provided for each need.

Install

Open a terminal window and run:

sudo apt-get install openjdk-7-jre # to be able to run
sudo apt-get install openjdk-7-jdk # to be able to compile
sudo apt-get install icedtea-7-plugin # to be able to run applets on browser

References

Ubuntu package information

Install Oracle Java 7 in [X]Ubuntu 12.04 Precise via PPA

Oracle Java is the alternative to OpenJDK package, but is not longer available in Ubuntu repositories (due to some change in Java License). Oracle Java remains my choice because I find it to work better with some applications (specially java web applets).

If you want to give OpenJDK a try, view here instructions to install it.

“WebUpd8” team provides a PPA with one package that automatically downloads and installs Oracle Java JDK/JRE/Plugin 7 from its official website and installs it on your computer.

Install

Open a terminal window and run:

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

References

Web Upd8

Wednesday, December 21, 2011

Install Sun Java 6 SDK on Xubuntu 11.10

Since 11.10 (X)Ubuntu does not provide the sun-java-jdk package, to install it open a terminal window and type:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin


References:
http://superuser.com/questions/353983/how-do-i-install-the-sun-java-sdk-in-ubuntu-11-10-oneric