You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Tom Klaasen <To...@the-ecorp.com> on 2000/08/18 10:59:39 UTC

RE: Please help me: Target ` ' does not exist in this project .

I think your problem is this:
<property...> is also a task, so should be defined within a target.

Try
<?xml version="1.0"?>
 
<project name="chat" default="main" basedir=".">
 <target name="init"> 
  <property name="src.dir" value="."/>
  <property name="build.dir" value="."/>
  <property name="jar.dir" value="."/>
  <property name="classpath" value="c:\java\lib\tools.jar"/>
 </target>

  <target name="main" depends="init">
    <javac srcdir="${src.dir}" destdir="${build.dir}" 
classpath="${classpath}">
      <include name="**/*.java"/>
    </javac>
  </target>

</project>

hth

tomK

> -----Original Message-----
> From: Jeroen Breedveld [mailto:j_breedveld@hotmail.com]
> Sent: donderdag 17 augustus 2000 23:44
> To: ant-user@jakarta.apache.org
> Subject: Please help me: Target ` ' does not exist in this project.
> 
> 
> Hi,
> 
> I get the following error when I use the build file belowe
> 
> error:
> Target `
> 
> 
> ' does not exist in this project.
> 
> buildfile:
> <?xml version="1.0"?>
> 
> <project name="chat" default="main" basedir=".">
> 
>   <property name="src.dir" value="."/>
>   <property name="build.dir" value="."/>
>   <property name="jar.dir" value="."/>
>   <property name="classpath" value="c:\java\lib\tools.jar"/>
> 
>   <target name="main">
>     <javac srcdir="${src.dir}" destdir="${build.dir}" 
> classpath="${classpath}">
>       <include name="**/*.java"/>
>     </javac>
>   </target>
> 
> </project>
> 
> I've looked the build file over and over but cannot find 
> anything wrong and 
> the error message is not very clear.
> 
> I'm using win98 with sun jdk 1.2.2
> 
> My ant.bat contains: java -Dant.home=c:\ant -cp 
> c:\ant\lib\ant.jar;c:\ant\lib\jaxp.jar;c:\ant\lib\parser.jar;c
> :\java\lib\tools.jar 
> org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
> I changed ant.bat because the standard didn't seem to work.
> 
> Can anyone help me?
> 
> greetings jeroen
> 
> 
> ______________________________________________________________
> __________
> Get Your Private, Free E-mail from MSN Hotmail at 
> http://www.hotmail.com
> 
> 

RE: Please help me: Target ` ' does not exist in this project.

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Tom,

Actually I think the original structure is preferred. Properties are not
tasks. While in the ant code there is a Property class which extends the
Task class, this is really an implementation detail. At the level of the
build file properties are different and they behave differently.

The most important difference is that properties are execute even if their
containing target is not. So if your init target is not executed, the
properties within it will still be set.

Conor


> -----Original Message-----
> From: Tom Klaasen [mailto:Tom.Klaasen@the-ecorp.com]
> Sent: Friday, 18 August 2000 19:00
> To: 'ant-user@jakarta.apache.org'
> Subject: RE: Please help me: Target ` ' does not exist in this project.
>
>
> I think your problem is this:
> <property...> is also a task, so should be defined within a target.
>
> Try
> <?xml version="1.0"?>
>
> <project name="chat" default="main" basedir=".">
>  <target name="init">
>   <property name="src.dir" value="."/>
>   <property name="build.dir" value="."/>
>   <property name="jar.dir" value="."/>
>   <property name="classpath" value="c:\java\lib\tools.jar"/>
>  </target>
>
>   <target name="main" depends="init">
>     <javac srcdir="${src.dir}" destdir="${build.dir}"
> classpath="${classpath}">
>       <include name="**/*.java"/>
>     </javac>
>   </target>
>
> </project>
>
> hth
>
> tomK
>
> > -----Original Message-----
> > From: Jeroen Breedveld [mailto:j_breedveld@hotmail.com]
> > Sent: donderdag 17 augustus 2000 23:44
> > To: ant-user@jakarta.apache.org
> > Subject: Please help me: Target ` ' does not exist in this project.
> >
> >
> > Hi,
> >
> > I get the following error when I use the build file belowe
> >
> > error:
> > Target `
> >
> >
> > ' does not exist in this project.
> >
> > buildfile:
> > <?xml version="1.0"?>
> >
> > <project name="chat" default="main" basedir=".">
> >
> >   <property name="src.dir" value="."/>
> >   <property name="build.dir" value="."/>
> >   <property name="jar.dir" value="."/>
> >   <property name="classpath" value="c:\java\lib\tools.jar"/>
> >
> >   <target name="main">
> >     <javac srcdir="${src.dir}" destdir="${build.dir}"
> > classpath="${classpath}">
> >       <include name="**/*.java"/>
> >     </javac>
> >   </target>
> >
> > </project>
> >
> > I've looked the build file over and over but cannot find
> > anything wrong and
> > the error message is not very clear.
> >
> > I'm using win98 with sun jdk 1.2.2
> >
> > My ant.bat contains: java -Dant.home=c:\ant -cp
> > c:\ant\lib\ant.jar;c:\ant\lib\jaxp.jar;c:\ant\lib\parser.jar;c
> > :\java\lib\tools.jar
> > org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
> > I changed ant.bat because the standard didn't seem to work.
> >
> > Can anyone help me?
> >
> > greetings jeroen
> >
> >
> > ______________________________________________________________
> > __________
> > Get Your Private, Free E-mail from MSN Hotmail at
> > http://www.hotmail.com
> >
> >
>