0

I have faced with a problem after I have changed the jdk version in intellij idea.

In my pom file I have next properties:

<source-jdk>1.8</source-jdk>
<target-jdk>1.8</target-jdk> 

And when maven is starting build project - at console showing the correct version of jdk - 1.8: C:\Program Files\Java\jdk1.8.0_131\bin\java

But when I am trying to start project the console showing the previous version of jdk: C:\Program Files\Java\jdk1.7.0_79\bin\java

Can anybody help me with this problem ?

I think that this is produce issue for me that i am not able to start the project.

THE PROBLEM RESOLVED see my own answer below

Andrew
  • 591
  • 2
  • 12
  • 33

4 Answers4

1

The problem was hiding inside "Edit configuration". You can choose jre version there.

Andrew
  • 591
  • 2
  • 12
  • 33
  • Yes, you can. But that is intended to be used only if you want to use different `jre`s for different `run configuration`. If you only have one such config, then it takes default value from project settings defined in `File > Project Structure > Project > Project SDK` – Sam Sep 01 '17 at 14:22
0

You have to set the environment variables for Java installation. Have a look here.

Also you have to set the Java version for your project. You can find here ho to.

0

Check your jdk path in your environment variable with version installed. If its not correct set the current jdk installed bin path in the environment variable, after this if problem persist, then simply use

`<java.version>1.8</java.version>`

in your pom.xml properties file

Braj Ankit
  • 333
  • 1
  • 2
  • 19
0

Concerning IntelliJ IDEA, you would need to ensure the following is set to what you expect:

  • File > Settings > Build, Exe.. > Compiler > Java Compiler > Target bytecode version
  • File > Project Structure > Project > Project SDK
  • File > Project Structure > Project > Project language level
  • File > Project Structure > Modules > select a module > Language level
Sam
  • 1,832
  • 19
  • 35