Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This

Downloading and Installing the Sun JDK

Open the FireFox browser by selecting Applications-> Internet -> Firefox Web Browser and browse to http://java.sun.com/javase/downloads/index.jsp. Select the JDK 6 Update 12 Download option. For the platform, select the Linux option, click the License agreement and select Continue.

When you get to the next screen, you can choose either an RPM file or a bin file. Choosing the bin file gives you more control over the destination location, so that's the file we'll use. Select the option to download to disk and the download should commence—time for a coffee.

When the download is complete, you should see something similar to Figure 2.

Figure 2

Figure 2 The download is complete.

We now have the download on the Linux desktop. As it happens, this is a disk location called /home/notroot/Desktop.

The first thing to note about the downloaded file is its extension: .bin. This is an executable file; to run it you must first modify the file attributes.

The easiest way to modify the attributes and run the file is to open a terminal from the Applications->Accessories menu, but first let's create a directory location into which the file extraction is to occur.

From the terminal window, change the directory to the /opt folder and create a directory (using the mkdir command) called java. Next, change the directory to java using the command cd java. Then copy the downloaded file to java with the command:

sudo cp /home/notroot/Desktop/jdk-6u12-linux-i586.bin

Now we must make the file executable with this command:

sudo chmod +x jdk-6u12-linux-i586.bin

Finally, we can now extract the contents of the download by running this command:

sudo ./jdk-6u12-linux-i586.bin

Hold the <Enter> key down until the end of the license agreement and then type yes to agree to the terms. The installation should then commence; at the end just press <Enter> to finish.

You can now register the JDK if you like. The important point is that the JDK is now installed in the path /opt/java/jdk1.6.0_12.

Now we need to make the JDK accessible for use in compiling Java code. To do this, we have to modify a file called .profile.

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.