Installing Sun JDK in OpenSuse 12.1

Most of the applications require sun JDK as prerequisite. OpenSuse above 12.1 versions does not includes sun java package in the repository by default due to license issues.

Follow the below steps to install Sun JDK in OpenSuse 12.1.

Check the current version from a terminal window.

>java -version

By default openJDK will be installed.Filter installed version of OpenJDK to uninstall it.

# rpm -qa | grep jdk

Remove it from the system. Replace your system specific OpenJDK version that you got from above command.

# rpm -e java-1_6_0-openjdk-

Verify that the default Java package is uninstalled.

which java

Download latest JDK rpm package from Oracle site(jdk-7u25-linux-x64.rpm)

change directory to Downloads directory to install JDK.

localhost:/home/hadoop/Downloads # rpm -ivh  jdk-7u25-linux-x64.rpm

All essential java commands seem works fine but there is something we have to commit, finally: Setting JAVA_HOME directory in PATH.

Suse stores all its profile information /etc/profile.d directory, grant access under the /etc/profile.d with root.

localhost:/etc/profile.d # su

Create file under /etc/profile. and write output of below echo command.

# echo 'export JAVA_HOME=/usr/java/jdk1.7.0_25'>/etc/profile.d/

Append output of echo command.

# echo 'export PATH=$JAVA_HOME/bin:$PATH'>>/etc/profile.d/


# source /etc/profile.d/

Finally, You have to logout and login to see the effect with your own user.