[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: Ant with a different JVM than Eclipse's JVM. (possible bug in JDTCompilerAda

Ant within Eclipse is run within the same VM that you launch Eclipse with.
Setting the JRE preference within Eclipse will have no impact on the JRE
used for your javac.
See http://bugs.eclipse.org/bugs/show_bug.cgi?id=24129

HTH
Darins

"Etienne Juliot" <gizmoo@xxxxxxxxxxx> wrote in message
news:b6cepp$tff$1@xxxxxxxxxxxxxxxx
> Olivier Thomann wrote:
>
> > On Tue, 1 Apr 2003 14:33:36 +0000 (UTC), gizmoo@xxxxxxxxxxx (Etienne
> > Juliot) wrote:
> > >3) I try to add "
> > >-Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter" in ant
argument,
> > >like say at
http://www.eclipse.org/eclipse/faq/eclipse-faq.html#users_16.
> > >I have always my warnings.
> > If you don't want the warnings with ant, in your javac task use
> > nowarn="on". By default you get the warning. This has nothing to do
> > with Eclipse. This is the way ant works.
>
>
> I know, but I want to choose kind of warning messages to show (for
> example, deprecated is very important but unused variable isn't).
> JDTCompilerAdapter was done to use features of Eclipse's compiler inside
> Ant. But, JDTCompilerAdapter doesn't use Eclipse's preferences.
>
> And, if I try to launch the ant compilation from dos, there aren't all
> these warnings.
>
>
> > >4) I try to use modern as build.compiler.
> > >I have this fail :
> > >..\BusinessApplication.java:41: cannot access java.lang.Object
> > >       [javac] bad class file: C:\Program
> > >Files\Java\j2re1.4.1\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]
> > You use 1.4.1 .class file on a 1.3 VM. This is not supposed to work.
> > Ant is using the same VM than the one you use to run Eclipse.
>
>
> Now, I am completly under 1.3. I configure Windows and Eclipse to use JVM
> 1.3.
>
> The JRE_LIB in Eclipse has the good JDK 1.3  rt.jar.
>
> If I add
>
> <echo message="build compiler : ${build_compiler}"/>
>
> in build.xml and I run ant from Eclipse, I have :
> [echo] 1.4.1
> !!
>
> Ant seem to be on a different version of JVM.
>
> If Eclipse propose only 1.3 in JRE installed, so Eclipse works on 1.3.
> Isn't it ?
>
> > >When Eclipse launch Ant, Eclipse uses internal PATH ?? Strange ...
> > As far as I know, ant is using the same VM than the Eclipse one. So if
> > you run Eclipse on a 1.4 VM, ant runs on a 1.4 VM.
>
> > In this case, you might want to set the target option of your javac
> > task.
>
> I try in <javac> tag attributes :
> - target
> - includeJavaRuntime/includeAntRuntime
> - fork
> - executable
> - source
> - compiler
>
> but nothing change.
>
>
> I found a bad solution. In Ant, I change the <javac> tag with adding :
>  bootclasspath="D:\jdk131\jre\lib\rt.jar"
>
> It's work.
> But I really don't understand and I can change all our build with a
> absolute path.
>
>
> In a perfect world :
> - OS uses one or more version of VM
> - In Eclipse, I choose in preference->JRE installed : JRE 1.3
> - When I run ant from Eclipse, ant is launched with JDK 1.3, javac 1.3 and
> rt.jar from JDK 1.3.
>
> But, perfect world don't exist ;(
> and ant seems to uses PATH system variable to found first javac command
> (very bad !).
>
>
> Etienne
>