I want to change to Java 11 from Java 8 in OS Leap 15.2. I successfully installed OpenJDK 11. The alternatives evidently were internally run so that Java 11 is now the alternative. However a number of Java environment variables, including JAVA_BIN_DIR, JAVA_HOME, and JAVA_ROOT still point to Java 8, while JRE_HOME points to Java 11. Do I just change these in my .profile to permanently affect a change or was there some other thing that is, or was, supposed to happen ?
Hi
I would have thought update-alternatives to take care of it, those look like manual entries not the defaults of JAVA_ROOT, JAVA_HOME and JAVA_BINDIR?
I see;
Tumbleweed
env | grep JAVA
JAVA_ROOT=/usr/lib64/jvm/jre-openjdk
JAVA_HOME=/usr/lib64/jvm/jre-openjdk
JAVA_BINDIR=/usr/lib64/jvm/jre-openjdk/bin
/usr/lib64/jvm/jre-openjdk/bin/java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-suse-1.3-x8664)
OpenJDK 64-Bit Server VM (build 11.0.8+10-suse-1.3-x8664, mixed mode)
Leap 15.2
env | grep JAVA
JAVA_ROOT=/usr/lib64/jvm/jre-11-openjdk
JAVA_HOME=/usr/lib64/jvm/jre-11-openjdk
JAVA_BINDIR=/usr/lib64/jvm/jre-11-openjdk/bin
/usr/lib64/jvm/jre-11-openjdk/bin/java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-suse-lp152.2.3.1-x8664)
OpenJDK 64-Bit Server VM (build 11.0.8+10-suse-lp152.2.3.1-x8664, mixed mode)
I have no entries for those environment variables in my .profile. I ran “sudo alternatives --config java” but java had evidently already been set to 11 rather than 8 after I installed the openjdk-11. So I have no idea where those environment variables come from. They don’t come from me.
Java 11 is in default Leap 15.2 install. You need to provide more details what you are trying to do and why.
a number of Java environment variables, including JAVA_BIN_DIR, JAVA_HOME, and JAVA_ROOT still point to Java 8, while JRE_HOME points to Java 11.
What about actually showing them instead of describing what you have seen?
It is not really a rocket science:
grep -r JAVA /etc/profile.d
Show list of installed java versions.