2

I have an issue and after many attempts don't know how to resolve it. I have Java/Maven project with JDK 6 and installed Maven 3.2.5 in Eclipse Luna Now I'm trying to run clean install command to create ZIP package but getting the following error message:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ABC: Fatal error compiling: invalid target release: 1.7

Does someone has this issue before and how do you resolve it.? Could you help me please? Thanks in advance.

Arsench
  • 179
  • 2
  • 4
  • 17

1 Answers1

2

The project you are attempting to compile specifies that the generated bytecode should be for Java 1.7. To do that you have to have a JDK7 or later.

Either change the project to specify 1.6, or upgrade your Java to 1.7. (There is really no reason to still stay on Java 1.6, it is old and obsolete now.)

JesperE
  • 63,317
  • 21
  • 138
  • 197
  • Many thanks Jesper for your answer, the problem I have is that client are using JDK6 and doesn't want to upgrade to 7 or 8. I have changed the project compiler to 6 , maybe there is another steps I'm missing? – Arsench Sep 05 '15 at 09:43
  • How does your maven pom.xml containing the maven-compiler-plugin configuration look like? – JesperE Sep 05 '15 at 10:22
  • Also, try to create a minimal reproducible example. Looking at the "effective pom" is also useful to rule out any overriding configurations. – JesperE Sep 05 '15 at 10:29
  • You're right Jesper, I just forget change the version in POM.xml, Thanks a lot for your help, now it works correctly – Arsench Sep 05 '15 at 13:33