0

I am new to programming and have compiler issue with Intellij idea it says :

"Error:java: invalid source release: 1.9."

Could any one help me ?

Thanks in advance.

Reda Maachi
  • 853
  • 6
  • 15
Guled
  • 19
  • See http://stackoverflow.com/a/12900859/104891. – CrazyCoder Mar 21 '17 at 16:16
  • Possible duplicate of [IDEA: javac: source release 1.7 requires target release 1.7](http://stackoverflow.com/questions/12900373/idea-javac-source-release-1-7-requires-target-release-1-7) – hmofrad Mar 21 '17 at 16:34

2 Answers2

1

Seems your IDE is looking for JDK 9 and you are compiling your code with different version.

Solution: Go to, Menubar --> File --> Project Stricture --> Project Settings --> Project

Check if you have any SDK(other than 1.9) installed in your system. If found, then select it.

Project Language: Select the same. click on Apply and OK. Rebuild your code and errors are gone

If no SDK found then download last version of JDK from here and point IntelliJ to it.

enter image description here

Pratik Ambani
  • 2,523
  • 1
  • 18
  • 28
0

It looks like you are trying to compile with a java version that is not java9, and your IDE is looking for java9 in the settings.

You will have to change the SDK version within IntelliJ - see Configuring Global, Project and Module SDKs

dumbPotato21
  • 5,669
  • 5
  • 21
  • 34
achAmháin
  • 4,176
  • 4
  • 17
  • 40