Various methods to set which JRE is used in SUSE Linux
This document (3578376) is provided subject to the disclaimer at the end of this document.
SUSE Linux Enterprise Desktop 10
The update-alternatives command (also "alternatives" on some SUSE Linux platforms) can be used to modify the /etc/alternatives/ symbolic links to point to different binaries. For example :
update-alternatives --config java
update-alternatives --config javacMethod 2 - altering the /etc/java/java2.conf file
With SUSE many applications are compiled to check the /etc/java/java2.conf file (or other files in the /etc/java directory if java2.conf doesn't exist). If no java2.conf file exists, copy one from an existing file in the same directory to java2.conf, and modify it accordingly. It will need all of the directories set appropriately (e.g."JRE_HOME=/opt/<nxxxll>/j2sdk-1.4.2_05/jre").
Method 3 - the unsupported hack of symlinks
In the /usr/lib directory, there should be a 'java' symbolic link. Rename this using :
mv /usr/lib/java /usr/lib/java.old
Then, create a new symbolic link to the new java directory's JDK. For example, if the new Java Development Kit is stored in /usr/lib/SunJava-1.4.2, the command would appear as :
ln -s /usr/lib/SunJava-1.4.2 /usr/lib/java
It may be wise to restart any java applications to ensure that they are still compatible with the intended Java environment and that the switch was made successfully.
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:3578376
- Creation Date: 27-Feb-2007
- Modified Date:15-Mar-2021
- SUSE Linux Enterprise Desktop
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com