Get a Free iPhone 4 from Xpango - click here

Wednesday, August 18, 2010

Easy Steps to install Java on Linux

Java is a programming language and computing platform first released by Sun Microsystems in 1995. It is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.

There are lots of applications and websites that won't work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!

So,i'm going to explain you step by step installtion of java on linux.

Step 1:
Download the Latest Version of java from http://java.com
Select the OS you would like to download for(window,linux,solaris).
There are two types of files to download.

1.Self extracting binary file.
This file can be used to install Java in a location chosen by the user and can be installed by anyone (not only root users). As long as you are not root user, it cannot displace the system version of the Java platform suppled by Linux.

2.RPM Package
Linux RPM (Redhat Package Manager) uses RPM to install Java. In order to use this method, you need to have RPM available on your system. Otherwise use the other option.

In this case we will download self extracting binary file.
I m using Java 6 update 13.

Step2.
Install as root for system wide java or if you want it just for yourself,extract the package in ~/bin/java or your home location.

a.Change the file permission.
chmod a+x  jdk-6u13-linux-i586.bin

b.Change to directory where you want to install
cd /usr/java/

c.Run the file.
./jdk-6u13-linux-i586.bin

Accept the license agreement.

Java gets installed in the directory
/usr/java/jdk1.6.0_13

Step 3.
Now, if you want to be able to execute this version of Java interpretor or compiler from any directory on your GNU/Linux system you will have to create a few symbolic links:

# ln -s /usr/java/jdk1.6.0_13/bin/java /usr/bin/java
# ln -s /usr/java/jdk1.6.0_13/bin/javac /usr/bin/javac

or

To make Java available to all users, add it to the default PATH settings by editing /etc/profile and adding:

PATH=$PATH:/usr/java/jdk1.6.0_13/bin

JAVA_HOME=/usr/java/jdk1.6.0_13

export $PATH $JAVA_HOME


Firefox or Mozilla
Create a symbolic link to the libjavaplugin.so file in the browser plugins directory
  • Go to the plugins sub-directory under the Firefox installation directory
    cd <Firefox installation directory>/plugins
  • Create the symbolic link
    ln -s <Java installation directory>/plugin/i386/
    ns7/libjavaplugin_oji.so
eg.
Go to mozilla folder

cd /usr/lib/mozilla/plugins


Create a symbolic link

ln -s /usr/java/jdk1.6.0_13/jre/plugin/i386/ns7/libjavaplugin_oji_so

No comments:

Post a Comment