Installing Sun's Java on openSUSE

From openSUSE

This article has been reviewed!
The content complies with community quality guidelines and is based on the approved Wiki Style Guidelines. Do not make major edit until it has been moved to the new wiki by the 'administrators'. Last changed: 19:54, 9 February 2010 (UTC)
Geeko Because of licensing issues Sun's Java Edition can not be included on the CDs of the download edition of openSUSE.


Here is a quick guide on how to install it.



Contents

Installing Java through YaST

  • Make sure that the openSUSE non-oss repository is enabled in Yast > Software Repositories.
  • Open 'Yast > Software Management'
  • Search for "Sun" in the filter/search box.
  • Install java-1_6_0-sun
Don't forget to install java-1_6_0-sun-plugin if you want Java support for your browser.



Installing Java manually

You may need to install Java (jre for what will be shown here) manually to get the up-to-date version.

Operating instructions are here [1], but not complete.

  • First you may have to uninstall the previous jre versions through YaST;
  • Download the Java runtime environment (jre) from Sun [2]
Use the "Linux RPM" for 32 bit or "Linux x64 RPM" for 64 bit openSUSE


  • Right click on the downloaded RPM file and select Open with Install Software
  • Enter root password and proceed with the installation
  • The jre will be installed in the folder /user/java.
  • Now we need to create symbolic link of the browser plugin to openSUSE default plugin folder:

For 32 bit Java (in 32 bit openSUSE)

ln -s /usr/java/<Java version>/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/browser-plugins/libjavaplugin_oji.so

For 64 bit Java

ln -s /usr/java/<Java version>/lib/amd64/libnpjp2.so /usr/lib64/browser-plugins/libnpjp2.so

Whereby <Java version> depends on the version of Java currently installed on your computer


  • Restart your web browser(s). Navigate to this page to test your Java installation.

Switching between two different Java JREs or SDKs

The current Java packages use the update-alternatives command. It creates symbolic links to the common Java binaries of the currently used Java version. This can be used to switch between different versions of installed Java JREs and SDKs (e.g. Sun Java 1.5, Sun Java 1.4.2 and IBM Java 1.4.2).

  • As root, you can call
update-alternatives --config java
to change all JRE-related links to one special JRE version
and
update-alternatives --config javac
to change all JDK-related links to one special SDK version
  • These commands will provide you with a menu that lists all possible JREs or SDKs.

Other Java related topics