javac: invalid target release: 1.8


Question

I recently downloaded JDK 1.8.0.0_06 that comes bundled with NetBeans. I then got to find out that my JavaFx project, that I have been developing in Java 1.7 won't compile in Java 1.8, and so I stepped down my JDK to 1.7. Still I can't get it to work/ compile. I get this error:

javac: invalid target release: 1.8
Usage: javac <options> <source files>

I'm really stuck and would greatly appreciate any help.

1
83
11/2/2016 8:55:59 AM

Accepted Answer

if you are going to step down, then change your project's source to 1.7 as well,

right click on your Project -> Properties -> Sources window 

and set 1.7 here

note: however I would suggest you to figure out why it doesn't work on 1.8

33
7/15/2014 7:54:12 PM

For IntelliJ14 you may have to change the bytecode version w.r.t. the JDK you are using (in the global settings):

enter image description here


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon