Why does each new revision of the JDK have its own installation directory?


I am a Java neophyte and I was going to dabble with it again today when I noticed I already had an installation of the JDK at C:\Program Files\Java\jdk1.7.0_05. I just downloaded the latest version and it wants to install to C:\Program Files\Java\jdk1.7.0_07.

Why does every new revision gets its own installation directory? Are the maintainers of Java not concerned with backward compatibility and breaking things with each new revision? I could understand a new directory for the move from version to, but from to That, I don't get. Can someone enlighten me?

It's not unusual to have to develop/test on multiple JDKs. The installer assumes that each JDK you install is there intentionally and does not interfere with them. Note that you should NOT be writing any code that includes the JDK path, so backwards compatibility with existing software should not be the issue. The way to set/refer to the "preferred" JDK is to use the JAVA_HOME environment variable. Most java aware applications will use whichever version is referred to by the JAVA_HOME path. There are also various OS specific ways to declare a preferred JDK/JRE. Windows uses a registry setting and Linux uses soft links.