Get a Free iPhone 4 from Xpango - click here
Showing posts with label jdk. Show all posts
Showing posts with label jdk. Show all posts

Thursday, August 19, 2010

Steps to Uninstall Java in Linux

There are two ways to uninstall Java. Please use the method that you used when you installed Java. For example, if you used RPM to install Java, then use the RPM uninstallation method.

RPM Package:

If the Java Development Kit was installed using RPM we can check it using ‘rpm -qa | grep jdk’. If this command shows any JDK version then you can easily remove the rpm package using
‘rpm –erase <javapackagename>‘

example:
Login as super user:su
rpm -qa |grep jdk

RPM reports package.
Unistall Java using :
rpm -e <jdk version>

Self Extracting File:

If the JDK was installed using self extraction zip file then we can directly remove the JDK folder using ‘rm -rf ‘

example:
In my box jdk is installed using selfextracting file and path is:
/usr/share/java-1.6.0/jdk1.6.0_13.

There is a way to find the java version we currently using.
Login as super user:su

update-alternatives --config java
It will show the java versions installed and currently used version.
You can select the version you need.

After locating jdk folder,remove the folder to uninstall.
In my case:

rm -rf /usr/share/java1.6.0/jdk1.6.0_13


If you are going to reinstall Java, you don't need to uninstall Java Plug-in. Just use the -f option for ln when creating a new symbolic link.
Example: ln -f /usr/lib/mozilla/plugins/libjavaplugin_oji.so

But in case you want to completely remove java,remove the symbolic link from mozilla plugin.

Login as super user:su

rm /usr/lib/mozilla/plugins/libjavaplugin_oji.so.

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