On May 11, 2009, at 3:57 PM, Jeppe Nejsum Madsen wrote:
Hi I'm struggling with Gradle on OS X and it seems either Gradle's startup script is not correct or my knowledge of Java on OS X is limited (entirely possible :-) My build (which requires JDK6) used to work on OS X 10.5.6 , but after I installed XCode I think it installed Java 5 as default. I then configured Java 6 as default (using the the provided Java control panel) $ java -version java version "1.6.0_07" Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153) Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode) But when I launch gradle, it still uses Java 5: ~/gradle/gradle-0.5.2/bin/gradle -v ---------------------------------------- Gradle 0.6-20090504092526+0200 ---------------------------------------- Gradle buildtime: 4. maj 2009 09:25:26 CEST Groovy: 1.5.6 Ant: Apache Ant version 1.7.0 compiled on December 13 2006 Ivy: 2.0.0-rc2 Java: 1.5.0_16 JVM: 1.5.0_16-133 JVM Vendor: Apple Inc. OS Name: Mac OS X I don't have JAVA_HOME defined and looking at the gradle startup script, it seems to look in Library/Java/Home first. This contain java5 which doesn't match the selected default JRE. Or am I just confused about java on OS X? Setting JAVA_HOME solves the problem, but I was wondering if this should be necessary?
Ant and Maven and many other Java tools request you to define JAVA_HOME. We are in the same line here. Although I am a Mac OS X user, I'm not an expert in how the Mac determines the default Java version, if multiple versions are installed. For many people it is important to set JAVA_HOME for using Gradle with a defined JDK. Our build script does some effort to set JAVA_HOME if it is not explicitly defined. To be honest, we took those mechanisms from the Groovy start up script. You may define a Jira and some Mac expert might eventually provide a fix.
Cheers, - Hans
/Jeppe --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
-- Hans Dockter Gradle Project lead http://www.gradle.org --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
