JEnv-for-Windows icon indicating copy to clipboard operation
JEnv-for-Windows copied to clipboard

"jenv list" not display jdk currently used after "jenv local" and then "jenv use" in a directory

Open longqinsi opened this issue 2 years ago • 1 comments

If I specify locally a jdk (i.e. jdk11) in a directory using "jenv local" command and then specify another jdk (i.e. jdk17) for the current session using "jenv use" command, then when I display the jenv environment using "jenv list" command, the output cannot tell me correctly which version of java I'm now using.

[somebody@HOME-PC datahub]# jenv local jdk11
Your replaced your java version for D:\idea_workspace\datahub jdk11
[somebody@HOME-PC datahub]# java --version
openjdk 11.0.20 2023-07-18
OpenJDK Runtime Environment Temurin-11.0.20+8 (build 11.0.20+8)
OpenJDK 64-Bit Server VM Temurin-11.0.20+8 (build 11.0.20+8, mixed mode)
[somebody@HOME-PC datahub]# jenv list
All avaible versions of java

name  path
----  ----
jdk8  D:\ProgramFiles\java\jdk8u382-b05
jdk11 D:\ProgramFiles\java\jdk-11.0.20+8
jdk17 D:\ProgramFiles\java\jdk-17.0.7+7


All locally specified versions

path                      name
----                      ----
D:\idea_workspace\datahub jdk11


[somebody@HOME-PC datahub]# jenv use jdk17
JEnv changed for the current shell session. Careful this overwrites "jenv local"
[somebody@HOME-PC datahub]# jenv list
All avaible versions of java

name  path
----  ----
jdk8  D:\ProgramFiles\java\jdk8u382-b05
jdk11 D:\ProgramFiles\java\jdk-11.0.20+8
jdk17 D:\ProgramFiles\java\jdk-17.0.7+7


All locally specified versions

path                      name
----                      ----
D:\idea_workspace\datahub jdk11

longqinsi avatar Jul 29 '23 09:07 longqinsi

Thank you for reporting

FelixSelter avatar Apr 09 '24 09:04 FelixSelter