Compiler incompatibility?



I am trying to compile a Java class, Foo, that has a dependency on another
Java class, Bar. I'm getting this message from the compile, which is taking
place in an Ant script:

[javac] Compiling 1 source file to
E:\eclipse\3.0.1\eclipse\workspace\RDS\bin

[javac]
E:\eclipse\3.0.1\eclipse\workspace\RDS\src\com\xyz\java\TextUDFs.java:58:
cannot access com.xyz.java.Bar

[javac] bad class file:
E:\eclipse\3.0.1\eclipse\workspace\RDS\bin\com\xyz\java\Bar.class

[javac] class file has wrong version 49.0, should be 48.0

[javac] Please remove or make sure it appears in the correct subdirectory of
the classpath.

[javac] private static Bar bar = null;

[javac] ^

[javac] 1 error


I'm not quite clear on what is going on here. Can anyone enlighten me?

The message makes it sound like the code for class Bar was generated with a
later compiler, e.g. 1.5.0, than the code for class Foo, e.g. 1.4.0, but I
don't think that is the case.

What do I need to do to make Foo and Bar play nicely together?

I'm using Ant 1.6.2 within Eclipse 3.1.1 on Windows XP (SP2).

--
Rhino


.



Relevant Pages

  • Re: Where to include header files / A question of style?
    ... 'foo' interface is correctly self-contained when you compile foo.cpp. ... In this case, you have a forward declaration of 'class Bar' in foo.h, ...
    (comp.lang.cpp)
  • Re: Import problem
    ... : use strict; ... : my $bar; ... : use Foo '%Bar'; ... the %Bar is not known to perl at compile time. ...
    (comp.lang.perl.misc)
  • Re: Compilation puzzle
    ... Let's say I have two classes Foo and Bar defined as: ... I can compile Foo first and then I can compile Bar with Foo in javac's ... It is not enough that Main doesn't reference Foo explicitly - the ...
    (comp.lang.java.help)
  • Compilation puzzle
    ... Let's say I have two classes Foo and Bar defined as: ... I can compile Foo first and then I can compile Bar with Foo in javac's ... It knows String and knows ...
    (comp.lang.java.help)
  • Re: A roguelike programming contest
    ... a client to directly include headers needed only indirectly ... Bar _bar; ... Your proscription would force a module using Foo to write: ... Forward declarations /where possible/ help reduce compile ...
    (rec.games.roguelike.development)