I had to install Netbeans & JDK in some PCs with no internet connectivity. That’s why, I needed to know how to install Java JDK properly and configure it. Though I mentioned Ubuntu 11.04 version, it should work with any version of newer Ubuntu.

Download Sun  JDK

Download the .bin file from official site.

Create Installation + Configuration Scripts

  1. Copy this code to a file name install.sh and put it in the directory where you put the downloaded jdk. When I prepared this script, jdk version was 1.6.0_25, if you install an upgraded version edit line #4 accordingly in this script.
  2. Now Copy code from this link & save it in a file name jdk_config.sh, put it in the same directory where you downloaded jdk.

[Note: I copied the original script from the link provided at the end of this article]

Install “java-common”

I’ll find an offline installer of this package and add later. Till then, you can install it by :

sudo apt-get install java-common

Ready to Install!

Right click all the three files (the JDK, install.sh & jdk_config.sh) and select properties. In the Permissions tab, put check mark on “allow executing file as program”

Then open a terminal, go to this directory where all these files exist (to avoid trouble you can put all these files in your home directory) and type:

./install.sh

That’ll do 🙂

Reference:

http://ju-n.net/properly-setting-up-sun-java-5-jdk-on-ubuntu-karmic-lucid

7 thoughts on “Download & Install Sun Java Jdk in Ubuntu 11.04

  1. Or you can enable the partner repo and download the package sun-java-jdk (I think that’s what it’s called…). I just did it then

    1. Certain, certain. But as I already mentioned, I had to download & then install them on an offline machine. So, I needed this approach.

      1. No, you didn’t. Just download the .deb and install it. My script was to install JDK 5.

Comments are closed.