Cannot start IntelliJ after changing jvm on mac

I uninstalled my jvm from 1.6 to restored the vm to 1.5. Intellij doesn't open anymore. Running it from console, throws the following error.

"unable to find a version of Java to launch"

I can easily launch java or javac via terminal (shows version as 1.5). I have a java_home variable set. Even eclipse and netbeans fire up theIDEs.

I even reinstalled Intellij, same problem.



When you say "uninstalled" what exactly do you mean?

Did you go and delete directories or muck about in the System directories?

Or did you simply do the correct thing and reorder the list of JVM's in the
Java Preferences (/Applications/Utilities/Java/Java Preferences).

If you did the former, you might need to do a system restore.


The only way I could get this work, is
-- to uninstall jre 1.6.
-- to reorder the jvm in "java preferences" utility menu, to java 5 (32bit), java5 (64bit)

And it works fine now. Note that it still doesn't work if the order of jvm is java 5 (64bit)

As for the original problem, it remains a mystery to me, a bug report from intellij suggested that it could be an apple bug.
(Making a Java Application Bundle). For some unknown reason uninstalling JDK 1.6 has broken the launcher behavior (which could be
Apple bug).