3 months ago I switched to Eclipse after using IntelliJ IDEA for years. I soon learned that Eclipse doesn't let you configure the JDK it uses to compile your workspace, but the strange thing is, it allows you to configure the JRE it will use to run your code. I thought that was odd and would probably cause me headaches someday. Well today is that day. Today, I learned the extent of the problem when I attempted to run an Ant script through Eclipse. Long story short, when using Eclipse make sure you run the
eclipse.exe with the
-vm switch to define which JDK it should use and make sure the
tools.jar in the Eclipse Ant classpath matches that same JDK. It's absolutely retarded that Eclipse allows them to be different. It caused me all kinds of 'class version mismatch' headaches. Why they thought it was a good idea to build projects and run Ant scripts in the same virtual machine that they run the GUI in is beyond me. IntelliJ IDEA has a much cleaner separation where they run their GUI in their own instance of the JVM (which they control tightly), and they allow you, the user, to specify what JDKs you have installed and which one to use on any given 'module' (Eclipse calls this a 'project') and which to use when running an Ant script. The beauty is its so flexible in IDEA that you can specify different JDKs for different modules and Ant scripts in the same IDEA project (a.k.a. Eclipse 'workspace'). I miss my IDEA.