Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javac: target release 7 conflicts with default source release 1.8 [duplicate]

Tags:

java

I am playing with javac and I cant compile simple java class to 1.7 version.

C:\Tests>javac -target 7 GreetingsUniverse.java -nowarn
javac: target release 7 conflicts with default source release 1.8

C:\Tests>javac -version
javac 1.8.0_73

What could be the reason?

like image 681
michealAtmi Avatar asked Feb 29 '16 22:02

michealAtmi


1 Answers

add a -source that matches your -target, so 1.7 I believe. Should fix it.

Otherwise you are compiling all those cool 1.8 closures onto a 1.7 jar to run on a 1.7 jvm which is just not going to work.

like image 199
Bill K Avatar answered Sep 21 '22 06:09

Bill K