Why the java version is 15.0.2?
Asked
Active
Viewed 685 times
1 Answers
0
Where do you see version 15.0.2? If it's Terminal tool window, java
executable is running from the first available directory in your system PATH
environment variable. Project settings do not affect Terminal.

CrazyCoder
- 389,263
- 172
- 990
- 904
-
Hi CrazyCoder, yes I saw that from Terminal when I type "java -version" – Alex Feb 03 '21 at 23:40
-
@Alex as already explained in my answer, Terminal will use `java.exe` from `PATH`. [See this answer](https://stackoverflow.com/a/58125957/104891) for more details how you can adjust it so that different Java version is used by default in your system. – CrazyCoder Feb 03 '21 at 23:41
-
So as long as I change the language level to 8, it should be 8, is that correct? – Alex Feb 03 '21 at 23:42
-
@Alex No, IDE project settings do not have any effect on the Terminal. The only way to change which `java.exe` is called from the Terminal is via the OS `PATH` environment. – CrazyCoder Feb 03 '21 at 23:43
-
@ CrazyCoder I changed it to 1.8 after I remove 15 from that path! Thanks – Alex Feb 03 '21 at 23:54