Jre expected but jdk found


After update to intellij 14 can't run simple one-class 'main' method application. This in the log:

2014-11-06 15:48:38,000 [2713286]   INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED (BUILD PROCESS)
2014-11-06 15:48:38,395 [2713681]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /opt/idea-IU-139.224.1/lib/jps-launcher.jar:/opt/java/lib/tools.jar:/opt/idea-IU-139.224.1/lib/optimizedFileManager.jar:/opt/idea-IU-139.224.1/lib/ecj-4.4.jar
2014-11-06 15:48:38,493 [2713779]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: 15:48:38,472 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.groovy] at [jar:file:/opt/idea-IU-139.224.1/plugins/gradle/lib/gradle.jar!/logback.groovy]
2014-11-06 15:48:38,493 [2713779]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: 15:48:38,474 |-ERROR in ch.qos.logback.classic.LoggerContext[default] - Groovy classes are not available on the class path. ABORTING INITIALIZATION.
2014-11-06 15:48:39,600 [2714886]   INFO - lij.compiler.impl.CompilerUtil -     COMPILATION FINISHED (BUILD PROCESS); Errors: 0; warnings: 0 took 1603 ms: 0 min 1sec
2014-11-06 15:48:39,624 [2714910]   INFO - tion.impl.ExecutionManagerImpl - Jre expected but jdk found
com.intellij.execution.CantRunException: Jre expected but jdk found
        at com.intellij.execution.util.JavaParametersUtil.a(JavaParametersUtil.java:139)
        at com.intellij.execution.util.JavaParametersUtil.a(JavaParametersUtil.java:117)
        at com.intellij.execution.util.JavaParametersUtil.configureModule(JavaParametersUtil.java:108)
        at com.intellij.execution.util.JavaParametersUtil.configureModule(JavaParametersUtil.java:104)
        at com.intellij.execution.application.ApplicationConfiguration$JavaApplicationCommandLineState.createJavaParameters(ApplicationConfiguration.java:266)
        at com.intellij.execution.configurations.JavaCommandLineState.getJavaParameters(JavaCommandLineState.java:36)
        at com.intellij.debugger.impl.GenericDebuggerRunner.createContentDescriptor(GenericDebuggerRunner.java:75)
        at com.intellij.debugger.impl.GenericDebuggerRunner.doExecute(GenericDebuggerRunner.java:67)
        at com.intellij.execution.runners.GenericProgramRunner.doExecute(GenericProgramRunner.java:50)
        at com.intellij.execution.runners.GenericProgramRunner$1.execute(GenericProgramRunner.java:43)
        at com.intellij.execution.RunProfileStarter.execute(RunProfileStarter.java:39)
        at com.intellij.execution.impl.ExecutionManagerImpl$2.run(ExecutionManagerImpl.java:203)
        at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:125)
        at com.intellij.execution.impl.ExecutionManagerImpl$1$1.run(ExecutionManagerImpl.java:168)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
        at java.awt.EventQueue.access$400(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:697)
        at java.awt.EventQueue$3.run(EventQueue.java:691)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
        at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:748)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:577)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384)

Removing run configuration and adding it back solves the problem. Google seems to doesn't know about it yet. Probably not a serious issue, but error message is quite strange. What could be the reason to demand  jre and reject jdk?

Best regards, Eugene.

Comment actions Permalink

This issue has me stumped. Recreating the runtime configuration is not helping me so I have to go back to IDEA 13 for now.

I am running on Yosemite and due to the fact that the Java that comes with the Apple Java 6 Developer Package crashes on startup (see https://devforums.apple.com/message/1051265), I have to run with the alternative JRE set to /System/Library/Frameworks/JavaVM.framework/Home which is the "Legacy" jre provided by Apple. This worked in 13 but unfortunately this seems to trigger the "Jre expected" error and so I cannot run my Java 6 project at all.


Comment actions Permalink

Hi guys,

I think this is a recent regression (in JavaParametersUtil.createAlternativeJdk).
There already is a bug for that: https://youtrack.jetbrains.com/issue/IDEA-132748

The problem is when one uses alternative JRE configuration in running java application, that's why recreating the configuration helped in Eugene case.

Richard, is it possible to download JRE and configure IDEA to ise it? In Linux/Windows world this is quite straightforward, but I'm not quite sure for OSX.


Comment actions Permalink

Thanks. It's disappointing to see that issue is closed as Won't Fix because the UI is confusing. If a configured JDK must be chosen then it shouldn't allow the user to enter a random file path in the combobox.

Now that I know that the JDK must be configured like that then yes, I can just configure a JDK for the Java 6 that actually works on Yosemite and it's all fine. Yay.

The problem that is unique to Mac OS X 10.10 is that the "Java 6 Developer Package" from Apple (which I would call the JDK) crashes every time it is run. The work around is to use the legacy java 6 install from http://support.apple.com/kb/DL1572 but of course that doesn't include javadocs and src. So I use the Developer Package as my JDK then use the legacy install as my alternative JRE.


Please sign in to leave a comment.