Target JRE version does not match project JDK version (null)

Answered

Hi,

 

Whenever i try to run my project i get the following warning:

My project settings seem to be configured correctly:

Does anyone have an idea what's wrong with my environment?

 

Thanks,

Nadav

 

11 comments
Comment actions Permalink

Hello,

Please check that JDK is also set for modules ("Project Structure | Modules - Dependencies")

 

0
Comment actions Permalink

Hi,

 

It is set on all my modules:

0
Comment actions Permalink

Hi,

 

Is there anything else I can check?

 

Thanks,

Nadav

0
Comment actions Permalink

Could you please attach screenshot from "Settings | Build... | Compiler | Java Compiler"?

0
Comment actions Permalink

Does the issue occur for any project or only for this specific one?

Please try the latest version from http://www.jetbrains.com/idea/download/index.html. In case the issue persists, please file a bug at https://youtrack.jetbrains.com/issues/IDEA and attach the project files there (.idea directory and .iml files).

You can also try to remove the JDK configuration and add it again from scratch in the Project Structure | SDKs dialog.

Ensure that the correct JDK is specified for every module (your screenshot confirms it only for one module).

0
Comment actions Permalink

Hi,

 

I tried the new version and the latest SDK with the same result.

However I noticed that when I select "Use JAVA_HOME" in the maven runner settings I get the error message.

If I select any other option the issue is resolved.

Thanks,

Nadav

0
Comment actions Permalink

I had similar issues with my gradle debugging but they went away when gave the two JRE's called "1.8" unique names.  I could then select the JRE that matched the Gradle JRE.

1
Comment actions Permalink

Wian's comment solved the issue for me. It's not helpful that the JDK / language level value being used needs to be changed in many places: Project, Modules, Gradle/Maven, Java compiler, on and on. For example, when updating from 1.8.0_131 to 1.8.0_161, it would be convenient if there was an option at the project level to declare: "Change all JDKs referenced in this project to the selected JDK 1.8.0_161", then let IDEA go about leveling them all up.

I recognize there are some complexities; i.e. one module needs to stay at JDK 1.7, etc., but that's already accommodated by the use Project JDK option on the module.

Alternatively, even a report in one place that showed all the various JDKs / JREs in use with a link to the settings page to change the value would be more helpful than some oblique toast message telling us some JDK for some unspecified context is out of sync with some JRE for some other unspecified context.

0
Comment actions Permalink

There is an option too on the running configuration:

1
Comment actions Permalink

Thanks, Peter, your answer solved my problem.

0

Please sign in to leave a comment.