0

I have multiple Mercurial clones of my project.

In my project there is a module that needs to use jdk 8. The rest of my project uses jdk 7. I configure that module to use jdk 8 by going to project structure, selecting the module, clicking the dependencies tab, and adding jdk 8.

So pretty much I'm following the instructions posted here: link.

The problem is, jdk8 gets added to the list of sdk's under "Platform Settings" in the project structure. The result is that when I open any other clone of my project in IntelliJ, jdk 8 gets set to the project sdk without any notice or warning. This is a problem since I need jdk 7 to be my project sdk not 8.

This smells like a bug pretending to be a feature. Is there any way to keep this from happening?

David
  • 14,569
  • 34
  • 78
  • 107
  • This is definitely not a feature; IntelliJ projects remember the name of the assigned JDK, and creating a new JDK should not affect any other projects. How exactly are you opening your project - through pom.xml or directly? – yole Feb 24 '15 at 22:48
  • Have you considered moving the module requiring jdk 8 to a different project? – vikingsteve Feb 25 '15 at 10:20
  • @yole, I usualy open other projects by going to file -> open -> navigating to and selecting the other project's pom, and clicking ok. It will then ask me if I want to overwrite the existing project and I click whichever button means "no". I then usually have it open the other project in a new window. – David Feb 25 '15 at 19:41
  • @vikingsteve I considered breaking out the module that requires jdk 8 into another project. The reasons for not doing so are purely practical not technical. – David Feb 25 '15 at 19:44
  • If you're opening the project through pom.xml, then the JDK used by IntelliJ is determined by the [Maven settings](http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html). – yole Feb 25 '15 at 20:26
  • David separarte projects would certainly do it, if you can live with the practical implications :) – vikingsteve Feb 25 '15 at 20:28

0 Answers0