Over a million developers have joined DZone.

Installing Java on Ubuntu

· DevOps Zone

The DevOps zone is brought to you in partnership with Sonatype Nexus. The Nexus suite helps scale your DevOps delivery with continuous component intelligence integrated into development tools, including Eclipse, IntelliJ, Jenkins, Bamboo, SonarQube and more. Schedule a demo today

 Recently I wanted to test Ant Commander on Linux. So I decided to install Ubuntu 12.04 in Virtual Box. Java doesn't seem to work out of the box, at least for applets. So I installed Oracle Java JRE for Linux.

The instructions on Oracle failed on my computer (rpm command failed to find some binaries needed for the installation) so I had to figure out how to install it.
Here are the instructions so you don't have to search for them. The instruction sudo passwd root is only if you don't have a root password yet.

Go to http://java.com/en/download/linux_manual.jsp
Download the Linux RPM version.

sudo passwd root


cd /usr

mkdir java

cd java

mv /home/#username#/Downloads/jre-7u9-linux-i586.rpm .

apt-get install alien

alien jre-7u9-linuxi586.rpm

dpkg -i jre_1.7.009-1_i386.deb

cd /usr/lib/firefox-addons/plugins/

ln -s /usr/java/jre1.7.0_09/lib/i386/libnpjp2.so .

You may also to open the Text Editor (Ubuntu -> Text Editor)
Open -> Type a file name icon (on the top left corner) -> .bashrc (from your home directory)
Add this line at the end


And save the file

The DevOps zone is brought to you in partnership with Sonatype Nexus. Use the Nexus Suite to automate your software supply chain and ensure you're using the highest quality open source components at every step of the development lifecycle. Get Nexus today


Published at DZone with permission of Anthony Goubard, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}