After upgrade to IDEA 2017.1, can't run tests or apps due to classloading issues

Answered

This happens in a Scala / SBT project (SBT 0.13.5, Scala 2.11.8).

The same configuration worked fine in IDEA 2016.x and I can't run it at all in IDEA 2017.1 with the following error:

/////////

objc[66846]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java (0x1031b94c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1032814e0). One of the two will be used. Which one is undefined.

Error: Could not find or load main class com.myPackage.myClass

///////////

This happens to all executable files & tests. 

i've verified the following:

  • Scala plugin updated & enabled. Files were indexed and project structure seems to be set up correctly after the upgrade.
  • Project Structure in IDEA is defined correctly and all the necessary files are in their correct paths
  • JAVA_HOME env var is set to the right location: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home
  • I've seen the article on the JDK warning above nad have my env vars set but that doesn't fix the problem: http://stackoverflow.com/questions/23590613/java-8-class-javalaunchhelper-is-implemented-in-both

Just to reiterate, this was working fine without problem in Intellij 16

0
5 comments

Serge, I have the same problem as Greg.

Issue IDEA-170117 is about "objc: Class JavaLaunchHelper is implemented in both ...".

I upgraded to JDK 8u152 Build b01, at least I thought so. Everywhere in the IDEA, and in Contents/Info.plist, Contents/jdk/Contents/Info.plist+version.plist. About IntelliJ IDEA says the JRE is still 1.8.0_112:

IntelliJ IDEA 2017.1
Build #IC-171.3780.107, built on March 22, 2017
JRE: 1.8.0_112-release-736-b13 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.11.5

What to do next? Could I send you a zip of my entire project directory?

 

0

JDK 8u152 has to be used to run your project, not to run IntelliJ IDEA.

0

Excuse me Serge; I was unclear. I have now only the problem 

  • Could not find or load main class

I have no idea what the problem is and how to fix this. Could you help me?

0

Please file a ticket to support with the sample project to reproduce attached: https://intellij-support.jetbrains.com/hc/requests/new.

0

Please sign in to leave a comment.