kolorobot / spring-mvc-quickstart-archetype

The project is a Maven archetype for Spring MVC web application.
http://blog.codeleak.pl
1.05k stars 478 forks source link

invalid target release: 1.8 #78

Closed enexusde closed 9 years ago

enexusde commented 9 years ago

Windows gives error in console: Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure Failure executing javac, but could not parse the error: javac: invalid target release: 1.8

in the same console i write mvn -v sais mvn 3.2.3, java 1.7.0_45, java-home is C:\Program Files\Java\jdk1.7.0_45\jre

in the same console i write javac -version gives: javac 1.7.0_45

in the same console i write java -version gives: java version "1.7.0_45"

%JAVA_HOME% gives: C:\Program Files\Java\jdk1.7.0_45

in the same console i write where javac gives: C:\Program Files\Java\jdk1.7.0_45\bin\javac.exe

Do i have jdk8 installed? yes

Any suggestion?

mdjebaile commented 9 years ago

Hi, If you are talking about the Maven project from archetype, the POM file speciifies

      <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>${java-version}</source>
                <target>${java-version}</target>
            </configuration>
        </plugin>

where java-version property is 1.8

So you need to change JAVA_HOME to JDK 1.8 and compile with that version.

Hope it helps! Cheers

enexusde commented 9 years ago

This is for Java 1.8 only?