0

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

  1. 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). enter image description here

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.

  1. 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. 1st Application 2nd Application

  2. I even use "JEnv" and it can still run the first application that uses jdk19 and has a level compliance of 18. enter image description here enter image description here

  • Does this answer your question? [Switching between two java versions on Windows](https://stackoverflow.com/questions/33212987/switching-between-two-java-versions-on-windows) – tgdavies Oct 09 '22 at 05:03
  • Another note. I did uninstall java 1.8 to check wether I can run both applications or not in jdk 19. It does run, however, I want to have both java version installed and can switch anytime I want without having to uninstall either versions. – Kenneth Arias Oct 09 '22 at 05:06
  • @tgdavies , no it does not. Jenv is just another tool to overwrite the path of each version. It does not block java runtime. In my case, in order to completely stop the updated java runtime from the previous version, I need to uninstall it in order for it to work. I even tried to remove all versions from the path and see if it can still run the 1st application, and it does. – Kenneth Arias Oct 11 '22 at 12:46

1 Answers1

-2

you can open run by pressing Win+R then type sysdm.cpl, hit okay and then go over to the advanced tab in the System Properties Window. On the Bottom Right you will see environment variables... I'm not too familiar with java applications but I had to adjust that before.

That is probably what you are looking for? I've also had problems when just deleting the java folders and not un-installing them properly from the add or remove programs setting

some guy
  • 1
  • 3