You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by qi...@freddiemac.com on 2004/07/21 23:17:44 UTC

javac abort problem

Hi all:

I am getting the same "javac-abort" problem as Jean.
But I am not happy about the "starndard behavior" described by Antoine.

Say, I am doing jsp pre-compilation. I know there might be errors.
I cannot fix it. Do not even know how to. So what am I going to do?

Is "failonerror=false" supposed to do this job? it never works for me 
though.

I saw some tricks to use trycatch tag. but it still would not help 
with this simpleest case:
<javac  srcdir="${mysrc}" destdir="${mydest}" fork="true"
              includes="**/*.java"   <!-- generated by JSP -->
                        failonerror="false" /> <!-- never work -->
              <classpath refid="compile.classpath"/>
</javac>

Abort when java encounter the fisr error. Any idea?



----------------------------------------------------
Date: Fri, 19 Dec 2003 12:45:42 +0100
From: Antoine Levy-Lambert <an...@antbuild.com>
Subject: ant 1..5.4  javac  failonerror no classes generated
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


Hi,
this is standard behavior of javac, you do not get any classes generated 
if one of the java files fails.
You can try to exclude from the fileset you want to compile the sources 
which are wrong (see the doc of the javac task to see how to nest 
filesets with sources).
The best thing to do however is to force the developers to fix the 
syntax errors or to move physically the bad sources outside of the 
repository location from which
you are taking the sources to compile.

for instance //repository/good ---> contains the normal stuff
                  //repository/bad    ---> contains classes that do not 
compile which are kept for historical reasons

Hopes this helps,

Antoine

Jean-Philippe Pattus wrote:

>hello the list,
>i'm trying to compile some sources. On my sources there are some errors, 
but i want to compile
>all the sources. I set failonerror to false, javac compile the sources, 
but the .classes are not generated
>in D:\Temp\bin.... It's bizarre, no?
>I'm sure the problem is between my chair and my screen, but i dont find 
the solution, if you can help me....
> 
>
>                <!-- Compilation des sources --> 
>                <javac srcdir="${srcInstallLocation}\source" 
destdir="D:\Temp\bin" debug="on" failonerror="false" >
>                                <!-- definition du classpath -->
>                                <classpath>
>                                                <path>
>                                                                <fileset 
dir="${srcInstallLocation}\classpath">
>  <include name="*.jar" />
>  <include name="*.zip" />
> </fileset>
>                                                </path>
>                                </classpath>
>                </javac> 
>
>
> 
>



Re: javac abort problem

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
qiming_he@freddiemac.com wrote:
> Hi all:
> 
> I am getting the same "javac-abort" problem as Jean.
> But I am not happy about the "starndard behavior" described by Antoine.
> 

The "standard behaviour" Antoine describes is not the behaviour of the 
<javac> Ant task but of the underlying javac compiler supplied by Sun. 
Just as you can't change your JSPs for whatever reason, we are unable to 
change the behaviour of javac.

You need to take this issue up with Sun. It wasn't always this way and 
was specifically changed so I assume they had good reasons for the change.

Conor

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org