Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javac: invalid target release: 1.8

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.

like image 243
Program-Me-Rev Avatar asked Jul 15 '14 19:07

Program-Me-Rev


People also ask

How do I fix an invalid target release?

Fix invalid target release error by changing Maven's Java version. You need to install a newer JDK and then update JAVA_HOME or PATH environment variables.

How do I fix Java warning Source Release 11 requires target release 11?

To Solve Error:java: invalid target release: 11 Error To resolve this issue I've changed File->Project Structure->Modules ->> Language level to 10. And check File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler ->> Project bytecode and Per-module bytecode versions.

What is fatal error compiling?

The problem is that there is mismatch in the Java/JDK versions. The project is trying to use a particular Java version to build the project. However, the system doesn't support the Java version the project is intended to build upon. First things first, decide on which Java/JDK version you want to use.


1 Answers

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

like image 142
vikasing Avatar answered Oct 05 '22 06:10

vikasing