SOLUTION: Syntax error, parameterized types are only available if source level is 5.0

I started getting a strange error today while compiling Groovy code with Maven. This caused me some grief as the issue was not happening while compiling with Intellij IDEA.

This is the error I was getting:

SOLUTION

Well, after quite a bit of hunting, I finally was going to attempt to change from JDK 1.6 to JDK 1.7 on Windows XP. When I attempted to edit my JAVA_HOME System environment variable, I noticed that some application installation must have created a new User environment variable for PATH and added C:\usr\bin\Java\jdk1.6.0_23\jre\bin to the PATH which was supersceding my C:\usr\bin\Java\jdk1.6.0_23\bin entry.

I removed the User PATH entry and this issue was resolved.

ADDITIONAL ISSUE

As I have continued to work on this same project, I ran into this error again. However, this started happening when I added the aspectj-maven-plugin to my project

Then by added a JDK compliance Level entry:

resulting in this:

the issue again was resolved. It appears that the aspectj-maven-plugin will overright the JDK level defined in the maven-compiler-plugin so by specifying this the build is successful again.

Mick Knutson

Java, JavaEE, J2EE, WebLogic, WebSphere, JBoss, Tomcat, Oracle, Spring, Maven, Architecture, Design, Mentoring, Instructor and Agile Consulting. http://www.baselogic.com/blog/resume

View all posts

Java / JavaEE / Spring Boot Channel

BLiNC Supporters

BLiNC Adsense

Archives

Newsletter