Start The World's Best Introduction to TDD... free!

Comments

I upgraded to Mac OS 10.10 Yosemite and something strange happened with my installations of IntelliJ IDEA. They just disappeared. I still don’t know what happened to them. When I tried to reinstall IDEA 13 Community Edition, it crashed on launch.

Fortunately, my Twitter community came to my rescue. I’m sharing my experience here, just to make it easier for those who upgrade after me. I found two solutions.

A Risky Solution

When I reinstalled Java SE 6 and made it my system Java virtual machine, IDEA 13 (and IDEA 14 beta) launched successfully. I followed these steps.

  1. Install Java SE 6, which Apple ships on its own .
  2. Add export JAVA_HOME=/usr/libexec/java_home -v “1.6.0” to your login shell initialization script which, for me, was .zshrc.

This, of course, provides a system-wide solution. It works, but it perpetuates an annoying dependency between IDEA and the state of my operating system. As with any reliance on global variables, it carries certain risk. It made me happy, then, that my Twitter community pointed me towards a more localized solution.

A Less Risky Solution

Thanks to this tweet, I have managed to solve the problem in a less risky fashion.

I followed these steps.

Setting the JRE that launches IDEA
Setting the JRE that launches IDEA
  1. Duplicate the IDEA .app launcher, so as to keep an old copy with which to test.
  2. Locate Contents/Info.plist inside the .app launcher and edit it. (“Show Package Contents” in Finder.)
  3. Look for the dictionary with key JVMOptions and find the value corresponding to JVMVersion.
  4. Change this value to 1.8 in order to look for a JRE matching what /usr/libexec/java_home -v ’1.8 would find.
  5. Launch the .app and verify that it launches.
  6. Remove Java SE 6 from the system path. (I tard it as a backup, then deleted it from /System/Library/Java/JavaVirtualMachines.)
  7. Launch the .app and verify that it still launches.
  8. Launch the other copy of the .app—still set to expect Java SE 6—and verify that it no longer launches.
  9. Change the JVMOptions/JVMVersion to 1.7*, while leaving Java 8 active as the system JRE.
  10. Launch the .app and verify that it still launches, even though Java SE 7 is not the system JRE.
  11. Change the JVMOptions/JVMVersion back to 1.8*, because I want to keep that value.

I much prefer this localized solution, as it breaks the dependency between IDEA and the system JRE.

Choose whichever solution works better for you. Enjoy!

References

stackoverflow.com, “IntelliJ not starting after OS X Yosemite update”.

Comments