Previously when I was writing Java code, I only needed to add the javapath +"/bin" inside the path for environment variables and I had no major problems. Recently I have been self learning Spring and it insists on having JAVA_HOME environment variable.
However, I now have multiple Java versions on my pc. If I setup to that specific java version provided by spring initializer, the Spring application can start just fine. What is the recommended approach? Added the remaining java versions to the JAVA_HOME variable - ie. path_jdk_17;path_jdk_16.01;path_jdk_8; etc.* or do I change it on the fly whenever I use a different application or different Spring project? (for some reason at different points in time the spring initializer suggests different default java versions to use, I m recommended to stick with the default suggested)
*note: not sure if this is allowed, since when adding new javapath to path variable they explicitly have the button to add new items, but not really for JAVA_HOME
JAVA_HOMEis not PATH-like, you can't put more than one JVM on the list. Essentially you change it on the fly - tools likesdkmando this for you.