Download & Install Sun Java Jdk in Ubuntu 11.04
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
- 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.
- 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
Steve 12:50 pm on May 9, 2011 Permalink |
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
Shafiul Azam 7:44 am on May 10, 2011 Permalink |
Certain, certain. But as I already mentioned, I had to download & then install them on an offline machine. So, I needed this approach.
nicoulaj 12:32 pm on May 10, 2011 Permalink
No, you didn’t. Just download the .deb and install it. My script was to install JDK 5.
Shafiul Azam 7:29 pm on July 29, 2011 Permalink |
@nicoulaj where did you find “the .deb file” ?
aaa 9:51 pm on January 31, 2012 Permalink |
Thank you for your useful post, but how can I install java-common if you said at the beginning that it is an offline install !!
You can find any deb package here: http://packages.ubuntu.com/
Shafiul Azam 10:09 pm on January 31, 2012 Permalink |
You are right! I was in a hurry & couldn’t find the .deb package. Can you please post a link for that?
aaa 5:50 pm on February 14, 2012 Permalink |
http://packages.ubuntu.com/oneiric/openjdk-7-jdk