0

I'm using Mule CE 3.7, who uses Maven to compile it's project. The problem is, when is compiling, he returns this error:

[ERROR] Detected JDK Version: 1.8.0-60 is not in the allowed range [1.7,1.8].

I already did all the solutions that i found, JAVA_HOME and PATH are configured.

If i run Java commands, they return me this:

MBP-de-axz:~ axz$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

MBP-de-axz:~ axz$ javac -version
javac 1.8.0_60

MBP-de-axz:~ axz$ mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T08:57:37-03:00)
Maven home: /usr/local/Cellar/maven/3.3.3/libexec
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre
Default locale: pt_BR, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.1", arch: "x86_64", family: "mac"

I already configured the Pom file of my project like this:

<requireJavaVersion>
     <version>[1.7,1.9)</version>
</requireJavaVersion>

So all is pointing to the same Java version. And this is happening in my Mac and Windows. The project only works if i change to Java 1.7, but i can use 1.7 because one of my libraries uses Java 1.8.

Anyone have an ideia of what could it be ?

Thanks !

JulianoFL
  • 40
  • 2
  • 8

3 Answers3

2

You probably want to use [1.7,1.9) as version range. This means it accept version between 1.7 (inclusive) until 1.9 (exclusive). Since 1.8.0_60 is bigger than 1.8, it was out of range with the previous version range. Btw, [1.8) would both include and exclude 1.8, so that shouldn't work.

Robert Scholte
  • 11,889
  • 2
  • 35
  • 44
  • I did what you told, but same thing. The strange is that the error is the same (range 1.7, 1.8), but i put in Pow file 1.7,1.9. Maven uses the file from the project right ? – JulianoFL Nov 22 '15 at 23:28
  • Did you include both the bracket and parenthese? What is the message? – Robert Scholte Nov 23 '15 at 17:36
  • Yes, i edited the post. The strange is the error is the same *is not in the allowed range [1.7,1.8]*. Looks like the Mule is not using the Pom file. – JulianoFL Nov 23 '15 at 18:53
  • Try `mvn help:effective-pom` to discover how Maven resolves the pom. That should show you where the message is coming from. – Robert Scholte Nov 23 '15 at 19:35
2

This error happens, when the maven JDK version and PROJECT JDK version doesn't match.

Inorder to fix that, try to find out the mvn jdk version first using

"mvn --version"

Then set the desired JDK version using set JAVA_HOME="c:\jdk_location_here". If you re-run the "mvn --version". You will see the updated JDK Version there.Now try to run your build.

Long term: Set the JAVA_HOME in environment variables.

Sireesh Yarlagadda
  • 12,978
  • 3
  • 74
  • 76
0

The problem is that Mule is not compatible yet with JDK 1.8, i need to use JDK 1.7

I should have read the requeriments.

JulianoFL
  • 40
  • 2
  • 8