ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: How to compile a java file?
Date Thu, 04 Sep 2003 05:42:58 GMT
> I've got a java source file ( that  I want to compile to get 
> foo.class.  How do I write an ant build.xml file to do this?

<project default="compile">
    <target name="compile">
        <javac srcdir="."/>

placed as build.xml in the directory containing (if that class 
has no package statement). Starting "ant" from shell.

BTW you should name classes with an upcase letter first: (common
code styleguide).

> I'm new to ant (and relatively new to java), so maybe there's 
> something 
> obvious I'm just not seeing.  I read the manual, and while it 
> describes 
> how to do complex things, it doesn't say how to do this most 
> simple and 
> obvious thing.

Yes, that´s written in java books "How to compile my classes".

I have written a small tutorial (damn - forgotten to upload that into cvs)
about writing tasks. If you read the first two chapters you´ll probably
get an idea of how using ant in build environment.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message