I am trying to build Groovy from source (on RH Linux) using ant, but for some reason it thinks that my Java version is 1.4, and not 1.6, and thus it won’t compile. The offending lines seem to be
<condition property='groovy.build.vm5'> <not> <contains string='${ant.java.version}' substring='1.4'/> </not> </condition>
in build.xml.
When I type javac -version on the command line, it displays ‘javac 1.6.0_11’. Any ideas?
Check the value of the environment variables JDK_HOME and JAVA_HOME.
EDIT: ‘which java’ will tell you which Java you’re getting when you run java from the command line. If this tells you, for example, that you’re getting ‘/usr/lib/jvm/java-6-sun/bin/java’, you can set ‘JAVA_HOME’ to ‘/usr/lib/jvm/java-6-sun’