Compiling with Ant

Compliling with an Ant task the compiler always complains that as of Java 1.4 assert is a keyword.

What do I have to specify in my Ant task to avoid this complaint (as we do have Assert as a class name in an external component).

In IntelliJ 4.0.3 using Ant 1.5.x we did not have this problem.

Below is the definition of the task.

]]>
<condition property="excludelist" value="$/util/corba/Bis.">
]]>
<!-- Compile von $ nach $ --> <javac srcdir="$"
destdir="$"
excludes="$,$"
debug="on">
<classpath path="$"/>
</javac>
</target>

Kind regards

Thomas Gülden

Munich, Germany

3 comments
Comment actions Permalink

Just add source="1.4" to your ]]> task.

0
Comment actions Permalink

I mean... if you're using "assert" as an identifier, you need to add source="1.3" to your task.

0
Comment actions Permalink

Hi,

Thanks for the help.

I tried this, but it does not work. Is here a bug in Ant or am I still something missing ?

<javac srcdir="$"
destdir="$"
source="1.3"
excludes="$,$"
debug="on">
<classpath path="$"/>
</javac>

Kind regards

Thomas Gülden
Munich, Germany

0

Please sign in to leave a comment.