1
votes

After breaking out the troubled command : /usr/jdk/jdk1.5.0_07/bin/java -Dant.home=. -cp $CLASSPATH:./build/classes org.apache.tools.ant.Main -emacs bootstrapI got the error: BUILD FAILED Could not load the version information

Before breaking out the above commad line I ran a complete ./build.sh and ./build install command and got: Buildfile: build.xml

bootstrap:

prepare:

check_for_optional_packages:

build: Created dir: /export/home/rs841k/tmp/apache-ant-1.6.0/build/lib Compiling 233 source files to /export/home/rs841k/tmp/apache-ant-1.6.0/build/cla sses javac: Does anyone have any idea what is happening here and how to resolve it?

1

1 Answers

1
votes

This is happening: You're passing source and target parameters to javac. Source seems to be 1.5, and target 1.1. This is a combination that is not allowed. The compiler does not know how to build JVM-1.1-compatible byte code from your sources, which might use 1.5-specific features.

This Oracle article explains the details:

javac does not accept a target (or compilation strategy) lower than the source language it is configured to accept. Each new version of the source language is generally accompanied by a new ClassFile version that allows the ClassFile to give meaning to new bytecode instructions, flags, and attributes. Encoding new source language constructs in older ClassFile versions is likely to be difficult. How would javac encode annotations from the Java 1.5 source language without the Runtime[In]Visible[Parameter]Annotations attributes that appeared in the 49.0 ClassFile?