Changing jdk's on PATH works only if you are opening projects. If you try to run an actual java application, even if you have succesfuly switch to another jdk version, it will only use the recent installed java version, in my case, the jdk 19. I have tried running java 19 and java 8 with a level compliace of SE 18 and SE 1.8 application. One modular and non-modular. In order for me to run the java 8 even if I switch to jdk 1.8, it will still run the application as jdk 19. To fix this, I need to uninstall java se 19. What I want to know is the exact way to change this execution without having to uninstall other java versions. To elaborate it clearly, I will attach some screenshot
- This is when I installed java 19 and run both applications. I can't show the other application since it doesn't run and doesn't show any errors(Which is why im asking how to switch between runtime environments).
NOTE: I even tried to switch to java 1.8 using the PATH switching method yet it can still run the application and the other still can't, which lead me to a conclusion that I need to change how java execute my programs.
This is when I uninstalled java 19 and run both applications. As you can see, clearly the first application shows error due to not having the updated jdk version. The other one, run's completely.
I even use "JEnv" and it can still run the first application that uses jdk19 and has a level compliance of 18.