Note that you are using target=1.2 in your build.xml for the javac task. Not sure if it plays a role in your problem.
I do not know what are exactly class file major versions 47 and 48.
I found only this doc about this type of issue : http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#80961
Cheers,
Antoine


Payette, Don J wrote:

I'm using eclipse for my IDE and my project has a build.xml.  Whenever I
do a
build, I right-click the build.xml and select Run Ant...  I then select
the
All target.  Works great.

Recently, my cohorts have suggested I need to switch from the 1.3.1 Java
to the 1.4.2
Java to be compatible with a new run environment.  I start eclipse with

        C:\eclipse\V2_1_3\eclipse\eclipse.exe eclipse -vm
C:\Java\j2sdk1.4.2_07\bin\javaw.exe
So it uses the newer java vm.   However I'm getting this when I do my
build:

       [echo] The classpath for compilation is
c:\Java\j2sdkee1.4.2_07\lib\j2ee.jar:jars/xerces.jar:jars/MCP.jar
       [echo] Java home is C:\Java\j2sdk1.4.2_07
      [javac] Compiling 307 source files to C:\SPEC\classes
      [javac] C:\SPEC\src\com\sun\jini\debug\Debug.java:177: cannot
access java.lang.Object
      [javac] bad class file:
C:\Java\j2sdk1.4.2_07\jre\lib\rt.jar(java/lang/Object.class)
      [javac] class file has wrong version 48.0, should be 47.0
      [javac] Please remove or make sure it appears in the correct
subdirectory of the classpath.
      [javac]     private String                propertyName;
      [javac]             ^
      [javac] 1 error
      [javac] BUILD FAILED: file:C:/SPEC/build.xml:110: Compile failed;
see the compiler error output for details.
Total time: 3 seconds

Any ideas what is going wrong and how to fix it?
Here is my build.xml:

build.xml
   <target name="compile">
   <echo message="The classpath for compilation is
${compile.classpath}" />
   <echo message="Java home is ${JAVA_HOME}" />
   <javac srcdir="src"
          deprecation="on"
           debug="on"
           destdir="classes"
           includes="**/*.java"
           excludes="**/charts*/*"
           target="1.2"
           classpath="${compile.classpath}"/>
   </target>







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to