Re: Compiler incompatibility?



The ANT javac task uses the JDK compiler. You must use a 1.4 version of
the JDK I guess.
The Eclipse project in the other hand uses the Eclipse compiler, which
must be set to 5.0 compliance level I guess.
Every time you save a .java file in your project it automatically
rebuild with the Eclipse compiler.
But when you start the execution of the ANT script in your project or
from the command line you use the JDK compiler and it can lead to
dependent .class files mismatch.
Two questions to be answered first:

1- In Eclipse:
From the menu: 'Window' / 'Preferences...'
In the window, left side: expand 'Ant' then click on 'Runtime'
On the right side: expand 'Global Entries'
*** What do you see? Do you have a tools.jar in it? Does it come from a
JDK 1.4? Else? ***

2- In Eclipse:
From the Package Explorer window: right-click on your project then
select 'Properties'
In the window, left side: click on 'Java Compiler'
*** On the right side, what is the compiler compliance level? ***

Regards

.



Relevant Pages

  • Re: Visual C++ 6 support issue
    ... Of course, Eclipse has the ... simpler syntax than C++ and is much easier to parse and analyse. ... A C++ compiler is quite a tricky beast to write (which is ... preprocessor symbols and language symbols (and of language symbols ...
    (microsoft.public.vc.mfc)
  • Re: Visual C++ 6 support issue
    ... Of course, Eclipse has the ... Apparently there is a discussion group going on in Microsoft which is discussing the tool ... >the same parsing job that the first couple of passes of the compiler ... And the compiler and the IDE are completely orthogonal. ...
    (microsoft.public.vc.mfc)
  • Re: Eclipse _mthclass$ problem
    ... > _mthclass$ to my compiled class file and when I compile the same ... Has anyone come across a way to get Eclipse to add this ... Eclipse does indeed have its own compiler that is an independent ... decide to use Sun's javac, you need to use Ant within Eclipse (right-click on ...
    (comp.lang.java.softwaretools)
  • Re: How Sun makes money from Java since it develops it and gives to everybody for free?
    ... converts from one high-level, OO, language (called "Java") to another, very ... but most of the bugs in javac or Eclipse seem to be (and have ... compiler and the Eclipse compiler might disagree on whether some code was legal ... since Eclipse uses Sun's JVM as the runtime for the code ...
    (comp.lang.java.programmer)
  • Re: Visual C++ 6 support issue
    ... Of course, Eclipse ... The parse is done by the compiler ... > Microsoft has tried to pass off as an editor) ... ...
    (microsoft.public.vc.mfc)