How to configure multiple java versions for different local users
This document (000021129) is provided subject to the disclaimer at the end of this document.
SUSE Linux Enterprise Server 12
1. Use the following command to check the current java versions available in the system:
# sudo rpm -qa | grep java2. To identify the path for the intended java version in the system, use the following command, replacing the java version determined in step 1:
# rpm -ql <java_version_xxxxx>3. Log in as the user "local user" (eg. testlocal):
# vi /home/testlocal/.bashrc4. Add the following lines to the .bashrc file, using the path determined above in step 2, then save the changes and exit:
export JAVA_HOME=<path_for_java_version_xxxxx> export PATH=$JAVA_HOME/bin:$PATH5. To reflect the changes:
# source /home/testlocal/.bashrc
Running java -version should now return the correct information.
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:000021129
- Creation Date: 05-Jul-2023
- Modified Date:19-Jul-2023
- SUSE Linux Enterprise Server
- SUSE Linux Enterprise Server for SAP Applications
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com