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]
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: