Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Problem using org.eclipse.jdt.core.JDTCompilerAdapter
Problem using org.eclipse.jdt.core.JDTCompilerAdapter [message #229099] Wed, 03 May 2006 08:34 Go to next message
Ian Meikle is currently offline Ian MeikleFriend
Messages: 3
Registered: July 2009
Junior Member
Hi,

We have a large project with many generated java files. I am trying to
compile these using the eclipse compiler from ant. The reason is that I
want the compiler to generate a class file even though there are compile
errors. Just like eclipse does.

However the compiler seems to stop after comming accross 5 compilation
errors. My ant file looks something like the following:

<property name="build.compiler"
value="org.eclipse.jdt.core.JDTCompilerAdapter" />

<javac srcdir="${project}\src\java"
includes="**\*.java"
destdir="${project}\bin"
verbose="true"
source="1.5"
failonerror="false"
nowarn="true"
debug="true"
debuglevel="lines, vars, and source">
<compilerarg compiler="org.eclipse.jdt.core.JDTCompilerAdapter"
line="-maxProblems 500" />
<classpath refid="project.classpath" />
</javac>

as you can see, I send "-maxProblems 500" which should mean that the
compiler will only give up after 500 errors. However it gives up after
only 5 !
The documentation
( http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. jdt.doc.isv/guide/jdt_api_compile.htm)
says that the default for -maxProblems is 100, however if I remove the
-maxProblems then it still gives up after 5 errors !

Has anyone else experianced this or am I doing something wrong ?

Many thanks in advance,
Ian
Re: Problem using org.eclipse.jdt.core.JDTCompilerAdapter [message #229152 is a reply to message #229099] Wed, 03 May 2006 14:04 Go to previous messageGo to next message
Olivier Thomann is currently offline Olivier ThomannFriend
Messages: 518
Registered: July 2009
Senior Member
Ian a écrit :
> <property name="build.compiler"
> value="org.eclipse.jdt.core.JDTCompilerAdapter" />
>
> <javac srcdir="${project}\src\java"
> includes="**\*.java"
> destdir="${project}\bin"
> verbose="true"
> source="1.5"
> failonerror="false"
> nowarn="true"
> debug="true"
> debuglevel="lines, vars, and source">
> <compilerarg compiler="org.eclipse.jdt.core.JDTCompilerAdapter"
> line="-maxProblems 500" />
> <classpath refid="project.classpath" />
> </javac>
Try to add -proceedOnError in the compilerarg element.
<compilerarg compiler="org.eclipse.jdt.core.JDTCompilerAdapter"
line="-maxProblems 500 -proceedOnError" />

I don't recommand the verbose mode as it is extremely verbose. If you
want to get details on what the compiler is doing, simply add an xml log.
You put verbose to false and you add: -log path_to_the_log.xml (the
extension needs to be .xml if you want an xml log. If you don't, then
simply put any other extension.) inside the compilerarg.

You debug level is wrong.
Should be: debuglevel="lines,vars,source"

HTH,
--
Olivier
Re: Problem using org.eclipse.jdt.core.JDTCompilerAdapter [message #229214 is a reply to message #229152] Thu, 04 May 2006 12:45 Go to previous messageGo to next message
Ian Meikle is currently offline Ian MeikleFriend
Messages: 3
Registered: July 2009
Junior Member
Hi Oliver,

The failonerror="false" javac target parameter adds the -proceedOnError
param.

Thanks for the -log tip, and catching that debugLevel was wrong.

I have now managed to get it too work. The problem was the type of compile
error I had. I had a problem in my classpath that meant that a required
class was not found. This caused an "<class> cannot be resolved. It is
indirectly referenced from required .class file" error. This kind of error
causes a build error in eclipse and prevents compilation. When I solved
this error, the compiler continued to spit out class files as I requested.

Thanks for the help
Ian
Re: Problem using org.eclipse.jdt.core.JDTCompilerAdapter [message #229469 is a reply to message #229152] Tue, 09 May 2006 11:54 Go to previous message
Ian Meikle is currently offline Ian MeikleFriend
Messages: 3
Registered: July 2009
Junior Member
Hi Oliver,
I am following on from your advise and using a -log path_to_the_log.xml
parameter to the compiler. Do you have a way of then reading this file in
Eclipse other than using the normal xml editor ?
Regards
Ian
Previous Topic:How to enable multiline option for regex searching in Eclipse?
Next Topic:Question about full qualified class names and inner classes of local classes
Goto Forum:
  


Current Time: Sat Jul 13 20:11:38 GMT 2024

Powered by FUDForum. Page generated in 0.03511 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top