Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.1
-
Fix Version/s: 2.0-beta-3, 1.8.7
-
Component/s: Ant integration
-
Labels:None
Description
Groovy 1.5.1 is compiled with Java 1.6. If I run a groovy task in an ant script where JAVA_HOME is set to a version preceding 1.6 or the PATH contains an reference to a JDK or JRE release preceding 1.6, I get an error:
C:\ant\build.xml:60: java.lang.UnsupportedClassVersionError: Bad version number in .class file
I'm able to resolve the problem by correctly defining JAVA_HOME or by setting the PATH variable. However, I do not want my builds to have dependencies on environment variables. Unless I've overlooked a configuration setting, will you please modify the groovy task to accept an optional attribute named 'executable', which would act just like the 'executable' attribute in the javac ant task, allowing the Java version to be defined in the groovy task, rather than being dependent on JAVA_HOME and PATH.
Thanks!
Hi Jeff, in general Groovy shouldn't depend on Java 1.6. Perhaps 1.5.1 was an anomaly - don't have it handy to test. Can you confirm that this is no longer an issue with any more recent release. If this problem has gone away, we can close this issue.