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

  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

Advertisements

How to Install Java JDK & Netbeans in Ubuntu

Every time you make a fresh installation of ubuntu, you need to download large software packages again. So the best way to save time is to download the installer files and store it in a different hard-disk drive. Later, we can simply double-click the installer file to install the application!

This tutorial is not only for Ubuntu Netbook remix. It can be used at any version of Ubuntu 🙂

1. Install JDK

We will use OpenJDK as your default JDK. JDK is needed to develop applications in Netbeans. Alternately, you can use Sun JDK

To install OpenJDK, type in terminal:

sudo apt-get update
sudo apt-get install openjdk-6-jdk

2. Download Netbeans from Official Site

Now we will download Netbeans. Go to Download link below:

Download page. Choose options you need.

3. Install

When download is completed, you will find a .sh file waiting for you. Give it executable permission- Copy the file to your home directory. Then open a terminal and type:

sudo chmod a+x filename.sh

Now, Simply double click it to install.

Alternately, you can run it from terminal. Copy the file to your home directory. Then open a terminal and type:

sudo sh filename.sh

Of course, replace filename.sh with the filename you just downloaded.

Now, store the large downloaded file to a safe location so that you may use it later, when you re-install Ubuntu!