coure2011 coure2011 - 5 months ago 25
Java Question

Detected JDK Version: 1.6.0-24 is not in the allowed range 1.7

When I ran the command

mvn clean package


I am getting error:

Detected JDK Version: 1.6.0-24 is not in the allowed range 1.7.


How to fix the above error? I tried to check jdk version isntalled and got this

java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)


how to fix this?

Answer

Normally when execute the mvn -v you may see something like

Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 
                    2013-02-19 20:51:28+0700)
Maven home: C:\Java.Application\Apache\apache-maven-3.0.5\bin\..
Java version: 1.7.0_15, vendor: Oracle Corporation
Java home: C:\Java.Application\Sun\Java\jdk1.7.0_15\jre
Default locale: en_US, platform encoding: MS874
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

If the result point to the JDK Version: 1.6.0-24 or other than your expect. Please simply set the JAVA_HOME to your JDK Version: 1.7.0_03 instead.

I hope this may help.

Comments