

Michael Borgwardt has made in the comments the interesting followup's question Plus, by setting $JAVA_HOME/bin or %JAVA_HOME%/bin in your path, you can dynamically change JAVA_HOME to whatever version of Java you want to use without having to much with your PATH variable.

Since scripts might depend on JAVA_HOME to launch themselves, again, this would be disasterous for a new Java install to modify JAVA_HOME: all those scripts would suddenly have to be launched with a new potentially incompatible JVM. This has nothing to do with an alleged "platform dependent issue".

It would be dangerous for the setup to modify a local environment variable such as JAVA_HOME, since it might reference an existing Java installation. You can install as many versions of Java as you like.
