Intellij 7+ Requires JDK 6

posted by Jake on

If you ever try and startup Intellij and see this error: "Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file....", you'll know that something's not quite right. It turns out that Intellij version 7 and above require JDK 6 to run properly. So, make sure to double-check the following points.

If you ever try and startup Intellij and see this error: "Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file....", you'll know that something's not quite right. It turns out that Intellij version 7 and above require JDK 6 to run properly. So, make sure to double-check the following points.

  1. Update alternatives

    sudo update-alternatives --config java
    
    And select JDK 1.6 or above.

  2. Set your JDK_HOME and JAVA_HOME

    emacs ~/.bashrc
    # edit the two lines to point to Java version 6:
    export JDK_HOME="/usr/lib/jvm/java-6-sun/"
    export JAVA_HOME="/usr/lib/jvm/java-6-sun/"
    

A lot of this was explained in the IntelliJ installation tutorial, but when I changed it later and found this error, I had forgotten about certain JDK-related requirements.

Leave a comment

blog comments powered by Disqus