title: How can I have multiple versions of the Java JDK installed on my machine at the same time?
body: <h1>Background</h1>
  
  <p>I work mostly in Java and Scala on my job, but a lot of our legacy code has not yet been updated to the most recent JDK. Thus, we have to have JDK versions 5, 6, 7, and 8 installed on our development machines. Until recently, I had been using Arch Linux, but I just switched to OpenSuse Tumbleweed. The method I used to install the JDK versions was to download the RPM installer scripts from the Oracle website and install them beginning with 1.5 and working my way up to 1.8 so that the <code>/usr/java/latest</code> symbolic link would already be pointing to the correct version.</p>
  
  <h1>Problem</h1>
  
  <p>After reinstalling the aforementioned JDK versions, I attempted to point to these installations in IntelliJ IDEA. But it complained with the error "<a href="https://stackoverflow.com/questions/21713414/intellij-the-selected-directory-is-not-a-home-for-jdk">The selected directory is not a valid home for JDK</a>". I have found a lot of resources online concerning this issue and ones like it, but none of those solutions helped in my case. Furthermore, the symbolic links in <code>/usr/bin</code> for the sundry Java executables were pointing to a conflagration of <code>/etc/alternatives</code> directives.</p>