ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rosemarie Hannan (Financial IQ)" <Rosemar...@fin-soft.co.za>
Subject compiling and creating jars ....
Date Wed, 30 Jan 2002 07:19:38 GMT
Hi 

I am having a problem trying to compile the following, I have set up my
class path in the environment and it still gives me the error - it creates
the java file, but does not compile and it fails just before I specify the
classname and path.  If any one can offer some suggestions I would
appreciate it.
Thanks


<!-- Simple Ant build script to test an Ant installation -->
<project name="TestInstall" default="run" basedir=".">

<target name="init">
 <available file="ASimpleHelloObject.java" property="ASimpleHelloObject"/>
</target>

<target name="ASimpleHelloObject" unless="ASimpleHelloObject"
depends="init">
 <echo file="ASimpleHelloObject .java">
public class ASimpleHelloObject
 {
 	public static void main(String [] args)
 	{
 		System.out.println("ASimpleHelloObject.main was called");
 	}
 }
  </echo>
  <echo message="Wrote ASimpleHelloObject.java"/>
 </target>
 
 <target name="compile" depends="ASimpleHelloObject">
  <javac destdir="." srcdir="." debug="on" classpath="c:\">

   <include name="ASimpleHelloObject.java"/>
  </javac>
     <echo message="in the compile block after the destdir"/>
 </target>
 
 <target name="run" depends="compile">
    <echo message="Before the classpath"/>
  <java classname="ASimpleHelloObject" classpath="."/>
    <echo message="Ant appears to be successfully installed"/>
 </target>
 
 </project>   		
****************************************************
Errors I am getting:

I even commented the one line of code - line 31, and the did the build, this
build went all the way through.  Please help me to find out what I have done
incorrectly.

****************************************************

C:\>ant -verbose
Ant version 1.4.1 compiled on October 11 2001
Buildfile: build.xml
Detected Java version: 1.3 in: C:\jdk1.3.1_01\jre
Detected OS: Windows 2000
parsing buildfile C:\build.xml with URI = file:C:/build.xml
Project base dir set to: C:\
Build sequence for target `run' is [init, ASimpleHelloObject, compile, run]
Complete build sequence is [init, ASimpleHelloObject, compile, run]

init:
[available] Unable to find C:\ASimpleHelloObject.java to set property
ASimpleHelloObje
ct

ASimpleHelloObject:
     [echo] Wrote ASimpleHelloObject.java

compile:
     [echo] in the compile block after the destdir

run:
     [echo] Before the classpath
     [java] Running in same VM ASimpleHelloObject

BUILD FAILED

C:\build.xml:31: Could not find ASimpleHelloObject. Make sure you have it in
your clas
spath
        at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:128)
        at org.apache.tools.ant.taskdefs.Java.run(Java.java:305)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:127)
        at org.apache.tools.ant.taskdefs.Java.execute(Java.java:88)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        at org.apache.tools.ant.Target.execute(Target.java:184)
        at org.apache.tools.ant.Target.performTasks(Target.java:202)
        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: 2 seconds



--
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