ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shaun Kalley <shaun_kal...@telus.net>
Subject New to Ant and having trouble with my first script
Date Sun, 26 May 2002 19:23:24 GMT
Hi, Group,

I've just started using Ant and I'm having trouble with my first script 
(included at the end of this message).  I'm using the binary download of 
Ant 1.4.1 on Windows 2000 and I get the following output when I execute the 
script in verbose mode:

--------------------------------------------------------------------------------
C:\Devassnmt2>ant -v
Ant version 1.4 compiled on September 3 2001
Buildfile: build.xml
Detected Java version: 1.4 in: C:\j2sdk1.4.0\jre
Detected OS: Windows 2000
parsing buildfile C:\Devassnmt2\build.xml with URI = 
file:C:/Devassnmt2/build.xm
l
Project base dir set to: C:\Devassnmt2
Build sequence for target `javadoc' is [init, compile, rmic, javadoc]
Complete build sequence is [init, compile, rmic, javadoc, jarserver, jarclient,
cleanup]

init:
     [mkdir] Created dir: C:\Devassnmt2\build
     [mkdir] Created dir: C:\Devassnmt2\docs\api

compile:

BUILD FAILED

C:\Devassnmt2\build.xml:14: The <javac> task doesn't support the "source" 
attrib
ute.
         at 
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHe
lper.java:273)
         at 
org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:658)
         at 
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:143)
         at org.apache.tools.ant.Task.maybeConfigure(Task.java:178)
         at org.apache.tools.ant.Task.perform(Task.java:216)
         at org.apache.tools.ant.Target.execute(Target.java:164)
         at org.apache.tools.ant.Target.performTasks(Target.java:182)
         at org.apache.tools.ant.Project.executeTarget(Project.java:601)
         at org.apache.tools.ant.Project.executeTargets(Project.java:560)
         at org.apache.tools.ant.Main.runBuild(Main.java:454)
         at org.apache.tools.ant.Main.start(Main.java:153)
         at org.apache.tools.ant.Main.main(Main.java:176)

Total time: 0 seconds
--------------------------------------------------------------------------------

When I remove the source attribute from the javac task, I get the following 
output:

--------------------------------------------------------------------------------
C:\Devassnmt2>ant -v
Ant version 1.4 compiled on September 3 2001
Buildfile: build.xml
Detected Java version: 1.4 in: C:\j2sdk1.4.0\jre
Detected OS: Windows 2000
parsing buildfile C:\Devassnmt2\build.xml with URI = 
file:C:/Devassnmt2/build.xm
l
Project base dir set to: C:\Devassnmt2
Build sequence for target `javadoc' is [init, compile, rmic, javadoc]
Complete build sequence is [init, compile, rmic, javadoc, jarserver, jarclient,
cleanup]

init:
     [mkdir] Created dir: C:\Devassnmt2\build
     [mkdir] Created dir: C:\Devassnmt2\docs\api

compile:
     [javac] .nbattrs skipped - don't know how to handle it
     [javac] ButtonTableHeaderIconFactory.java added as 
C:\Devassnmt2\build\Butto
nTableHeaderIconFactory.class doesn't exist.
     [javac] ButtonTableHeaderListener.java added as 
C:\Devassnmt2\build\ButtonTa
bleHeaderListener.class doesn't exist.
     [javac] ButtonTableHeaderRenderer.java added as 
C:\Devassnmt2\build\ButtonTa
bleHeaderRenderer.class doesn't exist.
     [javac] DataHandler.java added as 
C:\Devassnmt2\build\DataHandler.class does
n't exist.
     [javac] ReservationWizard.java added as 
C:\Devassnmt2\build\ReservationWizar
d.class doesn't exist.
     [javac] TableRow.java added as C:\Devassnmt2\build\TableRow.class 
doesn't ex
ist.
     [javac] TableRowSorter.java added as 
C:\Devassnmt2\build\TableRowSorter.clas
s doesn't exist.
     [javac] .nbattrs skipped - don't know how to handle it
     [javac] Data.java added as C:\Devassnmt2\build\Data.class doesn't exist.
     [javac] DatabaseException.java added as 
C:\Devassnmt2\build\DatabaseExceptio
n.class doesn't exist.
     [javac] DataConstants.java added as 
C:\Devassnmt2\build\DataConstants.class
doesn't exist.
     [javac] DataInfo.java added as C:\Devassnmt2\build\DataInfo.class 
doesn't ex
ist.
     [javac] FieldInfo.java added as C:\Devassnmt2\build\FieldInfo.class 
doesn't
exist.
     [javac] PortConstants.java added as 
C:\Devassnmt2\build\PortConstants.class
doesn't exist.
     [javac] .nbattrs skipped - don't know how to handle it
     [javac] RemoteData.java added as C:\Devassnmt2\build\RemoteData.class 
doesn'
t exist.
     [javac] .nbattrs skipped - don't know how to handle it
     [javac] DataServer.java added as C:\Devassnmt2\build\DataServer.class 
doesn'
t exist.
     [javac] Launcher.java added as C:\Devassnmt2\build\Launcher.class 
doesn't ex
ist.
     [javac] Modern compiler is not available - using classic compiler
     [javac] Compiling 16 source files to C:\Devassnmt2\build
     [javac] Using classic compiler
     [javac] Compilation args: -d C:\Devassnmt2\build -classpath 
C:\Devassnmt2\bu
ild;C:\j2sdk1.4.0\lib\tools.jar;C:\jakarta-ant-1.4.1\lib\jaxp.jar;C:\jakarta-ant
-1.4.1\lib\crimson.jar;C:\jakarta-ant-1.4.1\lib\ant.jar -sourcepath 
C:\Devassnmt
2\suncertify\client;C:\Devassnmt2\suncertify\db;C:\Devassnmt2\suncertify\net;C:\
Devassnmt2\suncertify\rmi;C:\Devassnmt2\suncertify\server -g:none
     [javac] Files to be compiled:
     C:\Devassnmt2\suncertify\client\ButtonTableHeaderIconFactory.java
     C:\Devassnmt2\suncertify\client\ButtonTableHeaderListener.java
     C:\Devassnmt2\suncertify\client\ButtonTableHeaderRenderer.java
     C:\Devassnmt2\suncertify\client\DataHandler.java
     C:\Devassnmt2\suncertify\client\ReservationWizard.java
     C:\Devassnmt2\suncertify\client\TableRow.java
     C:\Devassnmt2\suncertify\client\TableRowSorter.java
     C:\Devassnmt2\suncertify\db\Data.java
     C:\Devassnmt2\suncertify\db\DatabaseException.java
     C:\Devassnmt2\suncertify\db\DataConstants.java
     C:\Devassnmt2\suncertify\db\DataInfo.java
     C:\Devassnmt2\suncertify\db\FieldInfo.java
     C:\Devassnmt2\suncertify\net\PortConstants.java
     C:\Devassnmt2\suncertify\rmi\RemoteData.java
     C:\Devassnmt2\suncertify\server\DataServer.java
     C:\Devassnmt2\suncertify\server\Launcher.java


BUILD FAILED

C:\Devassnmt2\build.xml:14: Cannot use classic compiler, as it is not available
A common solution is to set the environment variable JAVA_HOME to your jdk 
direc
tory.
         at 
org.apache.tools.ant.taskdefs.compilers.Javac12.execute(Javac12.java:
96)
         at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:530)
         at org.apache.tools.ant.Task.perform(Task.java:217)
         at org.apache.tools.ant.Target.execute(Target.java:164)
         at org.apache.tools.ant.Target.performTasks(Target.java:182)
         at org.apache.tools.ant.Project.executeTarget(Project.java:601)
         at org.apache.tools.ant.Project.executeTargets(Project.java:560)
         at org.apache.tools.ant.Main.runBuild(Main.java:454)
         at org.apache.tools.ant.Main.start(Main.java:153)
         at org.apache.tools.ant.Main.main(Main.java:176)

Total time: 0 seconds
--------------------------------------------------------------------------------

I've read the documentation and the javac task should support the source 
attribute (and making sure it does is important as I employ several 
assertion statements in my code and it won't compile unless I can specify 
the source version as 1.4).

Any suggestions or advice would be extremely welcomed.

Thanks,
Shaun

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="javadoc" name="Devassnmt2">

     <property name="build" value="build" />
     <property name="build.compiler" value="modern" />

     <target name="init">
         <tstamp/>
         <mkdir dir="./${build}" />
         <mkdir dir="./docs/api" />
     </target>

     <target depends="init" name="compile">
         <javac destdir="./${build}">
             <src path="./suncertify/client" />
             <src path="./suncertify/db" />
             <src path="./suncertify/net" />
             <src path="./suncertify/rmi" />
             <src path="./suncertify/server" />
         </javac>
     </target>

     <target name="rmic" depends="compile">
         <rmic base="./${build}" classname="./suncertify.server.DataServer" />
     </target>

     <target depends="compile" name="jarclient">
         <jar basedir="./${build}" jarfile="./suncertify.client.jar" />
     </target>

     <target depends="compile,rmic" name="jarserver">
         <jar basedir="./${build}" jarfile="./suncertify.server.jar"/>
     </target>

     <target depends="compile,rmic" name="javadoc">
         <javadoc author="true" destdir="./docs/api" doctitle="Fly By Night 
Services&lt;br&gt;API Specification" link="file:/C:/j2sdk1.4.0/docs/api" 
public="true" sourcepath="." version="true" windowtitle="Fly By Night 
Services API Specification">
             <package name="suncertify.client" />
             <package name="suncertify.db" />
             <package name="suncertify.net" />
             <package name="suncertify.rmi" />
             <package name="suncertify.server" />
         </javadoc>
     </target>

     <target name="cleanup">
         <delete dir="./${build}" />
     </target>
</project>


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


Mime
View raw message