You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by veena pandit <v....@gmail.com> on 2009/09/09 18:04:34 UTC

path problems in build.xml

 I have the following in my build.xml, but it complains about an import:
*

import* org.apache.axis2.util.OptionsParser;
I thought this class is part of the axis 2 package.  Can anyone help me
fix this?

Thanks,

Sonia


<target name="compile.service">

<mkdir dir="${build.dir}"/>

<mkdir dir="${build.dir}/classes"/>

<!--First let's compile the classes-->

<javac debug="on"

fork="true"

destdir="${build.dir}/classes"

srcdir="${basedir}/src"

classpathref="axis2.classpath">

<classpath>

<fileset dir="lib">

<include name="**.jar"/>

</fileset>

</classpath>

</javac>

</target>

Re: path problems in build.xml

Posted by veena pandit <v....@gmail.com>.
Anybody want to take a shot at my problem?  When I do ant compile.service on
the command line,
I get an error saying that it cant find the import.

Thanks,

Sonia

On Wed, Sep 9, 2009 at 5:19 PM, Greg Roodt <gr...@gmail.com> wrote:

> Hi
>
> I think you've answered your own question. Its looking for a JDK, but your
> JAVA_HOME references the JRE.
>
> Try setting JAVA_HOME to /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0
>
> Greg
>
>
>
>
>
> On Wed, Sep 9, 2009 at 10:20 PM, Kerry Scott <kerry.scott@talktalk.net
> >wrote:
>
> > Hi
> > I have problems running Ant and I am sure that it is somehow a PATH
> > problem but I have wrestled it to my death for 48 hours and would love
> > some ideas.
> > Platform - Mandriva Linux 2009 which has an Ant RPM - I have deleted it
> > and tried to use the version downloaded - it didn't come with Ant but
> > Ant.bat, Ant.cmd were included so I copied the Ant shell program from
> > the Mandriva RPM release
> > Symptoms: if I don't set ANT_HOME it cannot find the standard Java class
> > libraries so the compile dies on java.lang.Object cannot be resolved.
> > If I do set ANT_HOME  I get the error: Unable to find a javac compiler;
> > com.sun.tools.javac.Main is not on the classpath.
> > Perhaps JAVA_HOME does not point to the JDK.
> > It is currently set to "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre"
> >
> > Any ideas
> >
> > Cheers
> >
> > Kerry
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>

Re: path problems in build.xml

Posted by Kerry Scott <ke...@talktalk.net>.
setting JAVA_HOME has no effect unfortunately - maybe there is some
incompatibility between Ant and Mandriva; I tried a succession of
CLASSPATHS without success so I have now given up and installed Eclipse
- doing it the slightly harder way but at least it works !!


-----Original Message-----
From: Greg Roodt <gr...@gmail.com>
Reply-to: "Ant Users List" <us...@ant.apache.org>
To: Ant Users List <us...@ant.apache.org>, kerry.scott@talktalk.net
Subject: Re: path problems in build.xml
Date: Thu, 10 Sep 2009 01:28:54 +0100

Ok, my last guess would be you need JAVA_HOME= /usr/lib/jvm/java.



On Wed, Sep 9, 2009 at 11:02 PM, Kerry Scott <ke...@talktalk.net>wrote:

> Thanks Greg but..
> when I do that it can't find tools.jar which is in /usr/lib/jvm/java/lib
>
>
> -----Original Message-----
> From: Greg Roodt <gr...@gmail.com>
> Reply-to: "Ant Users List" <us...@ant.apache.org>
> To: Ant Users List <us...@ant.apache.org>, kerry.scott@talktalk.net
> Subject: Re: path problems in build.xml
> Date: Wed, 9 Sep 2009 22:19:00 +0100
>
> Hi
>
> I think you've answered your own question. Its looking for a JDK, but your
> JAVA_HOME references the JRE.
>
> Try setting JAVA_HOME to /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0
>
> Greg
>
>
>
>
>
> On Wed, Sep 9, 2009 at 10:20 PM, Kerry Scott <kerry.scott@talktalk.net
> >wrote:
>
> > Hi
> > I have problems running Ant and I am sure that it is somehow a PATH
> > problem but I have wrestled it to my death for 48 hours and would love
> > some ideas.
> > Platform - Mandriva Linux 2009 which has an Ant RPM - I have deleted it
> > and tried to use the version downloaded - it didn't come with Ant but
> > Ant.bat, Ant.cmd were included so I copied the Ant shell program from
> > the Mandriva RPM release
> > Symptoms: if I don't set ANT_HOME it cannot find the standard Java class
> > libraries so the compile dies on java.lang.Object cannot be resolved.
> > If I do set ANT_HOME  I get the error: Unable to find a javac compiler;
> > com.sun.tools.javac.Main is not on the classpath.
> > Perhaps JAVA_HOME does not point to the JDK.
> > It is currently set to "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre"
> >
> > Any ideas
> >
> > Cheers
> >
> > Kerry
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



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


Re: path problems in build.xml

Posted by Greg Roodt <gr...@gmail.com>.
Ok, my last guess would be you need JAVA_HOME= /usr/lib/jvm/java.



On Wed, Sep 9, 2009 at 11:02 PM, Kerry Scott <ke...@talktalk.net>wrote:

> Thanks Greg but..
> when I do that it can't find tools.jar which is in /usr/lib/jvm/java/lib
>
>
> -----Original Message-----
> From: Greg Roodt <gr...@gmail.com>
> Reply-to: "Ant Users List" <us...@ant.apache.org>
> To: Ant Users List <us...@ant.apache.org>, kerry.scott@talktalk.net
> Subject: Re: path problems in build.xml
> Date: Wed, 9 Sep 2009 22:19:00 +0100
>
> Hi
>
> I think you've answered your own question. Its looking for a JDK, but your
> JAVA_HOME references the JRE.
>
> Try setting JAVA_HOME to /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0
>
> Greg
>
>
>
>
>
> On Wed, Sep 9, 2009 at 10:20 PM, Kerry Scott <kerry.scott@talktalk.net
> >wrote:
>
> > Hi
> > I have problems running Ant and I am sure that it is somehow a PATH
> > problem but I have wrestled it to my death for 48 hours and would love
> > some ideas.
> > Platform - Mandriva Linux 2009 which has an Ant RPM - I have deleted it
> > and tried to use the version downloaded - it didn't come with Ant but
> > Ant.bat, Ant.cmd were included so I copied the Ant shell program from
> > the Mandriva RPM release
> > Symptoms: if I don't set ANT_HOME it cannot find the standard Java class
> > libraries so the compile dies on java.lang.Object cannot be resolved.
> > If I do set ANT_HOME  I get the error: Unable to find a javac compiler;
> > com.sun.tools.javac.Main is not on the classpath.
> > Perhaps JAVA_HOME does not point to the JDK.
> > It is currently set to "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre"
> >
> > Any ideas
> >
> > Cheers
> >
> > Kerry
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: path problems in build.xml

Posted by Kerry Scott <ke...@talktalk.net>.
Thanks Greg but..
when I do that it can't find tools.jar which is in /usr/lib/jvm/java/lib


-----Original Message-----
From: Greg Roodt <gr...@gmail.com>
Reply-to: "Ant Users List" <us...@ant.apache.org>
To: Ant Users List <us...@ant.apache.org>, kerry.scott@talktalk.net
Subject: Re: path problems in build.xml
Date: Wed, 9 Sep 2009 22:19:00 +0100

Hi

I think you've answered your own question. Its looking for a JDK, but your
JAVA_HOME references the JRE.

Try setting JAVA_HOME to /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0

Greg





On Wed, Sep 9, 2009 at 10:20 PM, Kerry Scott <ke...@talktalk.net>wrote:

> Hi
> I have problems running Ant and I am sure that it is somehow a PATH
> problem but I have wrestled it to my death for 48 hours and would love
> some ideas.
> Platform - Mandriva Linux 2009 which has an Ant RPM - I have deleted it
> and tried to use the version downloaded - it didn't come with Ant but
> Ant.bat, Ant.cmd were included so I copied the Ant shell program from
> the Mandriva RPM release
> Symptoms: if I don't set ANT_HOME it cannot find the standard Java class
> libraries so the compile dies on java.lang.Object cannot be resolved.
> If I do set ANT_HOME  I get the error: Unable to find a javac compiler;
> com.sun.tools.javac.Main is not on the classpath.
> Perhaps JAVA_HOME does not point to the JDK.
> It is currently set to "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre"
>
> Any ideas
>
> Cheers
>
> Kerry
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



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


Re: path problems in build.xml

Posted by Greg Roodt <gr...@gmail.com>.
Hi

I think you've answered your own question. Its looking for a JDK, but your
JAVA_HOME references the JRE.

Try setting JAVA_HOME to /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0

Greg





On Wed, Sep 9, 2009 at 10:20 PM, Kerry Scott <ke...@talktalk.net>wrote:

> Hi
> I have problems running Ant and I am sure that it is somehow a PATH
> problem but I have wrestled it to my death for 48 hours and would love
> some ideas.
> Platform - Mandriva Linux 2009 which has an Ant RPM - I have deleted it
> and tried to use the version downloaded - it didn't come with Ant but
> Ant.bat, Ant.cmd were included so I copied the Ant shell program from
> the Mandriva RPM release
> Symptoms: if I don't set ANT_HOME it cannot find the standard Java class
> libraries so the compile dies on java.lang.Object cannot be resolved.
> If I do set ANT_HOME  I get the error: Unable to find a javac compiler;
> com.sun.tools.javac.Main is not on the classpath.
> Perhaps JAVA_HOME does not point to the JDK.
> It is currently set to "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre"
>
> Any ideas
>
> Cheers
>
> Kerry
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: path problems in build.xml

Posted by Kerry Scott <ke...@talktalk.net>.
Hi
I have problems running Ant and I am sure that it is somehow a PATH
problem but I have wrestled it to my death for 48 hours and would love
some ideas.
Platform - Mandriva Linux 2009 which has an Ant RPM - I have deleted it
and tried to use the version downloaded - it didn't come with Ant but
Ant.bat, Ant.cmd were included so I copied the Ant shell program from
the Mandriva RPM release
Symptoms: if I don't set ANT_HOME it cannot find the standard Java class
libraries so the compile dies on java.lang.Object cannot be resolved.
If I do set ANT_HOME  I get the error: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre"

Any ideas

Cheers

Kerry



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


Re: path problems in build.xml

Posted by veena pandit <v....@gmail.com>.
This is my complete build.xml;  when I execute ant compile.service it
complains
about the package.

Thanks,

Sonia

<project name="quickstart" basedir="." default="generate.service">

<property environment="env"/>

<property name="AXIS2_HOME" value="../.."/>

<property name="build.dir" value="build"/>

<path id="axis2.classpath">

<fileset dir="${AXIS2_HOME}/lib">

<include name="*.jar"/>

</fileset>

</path>

<target name="compile.service">

<mkdir dir="${build.dir}"/>

<mkdir dir="${build.dir}/classes"/>

<!--First let's compile the classes-->

<javac debug="on"

fork="true"

destdir="${build.dir}/classes"

srcdir="${basedir}/src"

classpathref="axis2.classpath">

<classpath>

<fileset dir="lib">

<include name="**.jar"/>

</fileset>

</classpath>

</javac>

</target>

<target name="generate.wsdl" depends="compile.service">

<*taskdef name="java2wsdl"

classname="org.apache.ws.java2wsdl.Java2WSDLTask"

classpathref="axis2.classpath"/>
*

<java2wsdl className="com.ngc.wsServer.RunService"

outputLocation="${build.dir}"

targetNamespace="http://quickstart.samples/"

schemaTargetNamespace="http://quickstart.samples/xsd">

<classpath>

<pathelement path="${axis2.classpath}"/>

<pathelement location="${build.dir}/classes"/>

</classpath>

</java2wsdl>

</target>

<target name="generate.service" depends="compile.service">

<!--aar them up -->

<copy toDir="${build.dir}/classes" failonerror="false">

<fileset dir="${basedir}/resources">

<include name="**/*.xml"/>

</fileset>

<fileset dir="${basedir}/lib">

<include name="**/*.jar"/>

</fileset>

</copy>

<jar destfile="${build.dir}/RunService.aar">

<fileset excludes="**/Test.class" dir="${build.dir}/classes"/>

</jar>

</target>

<target name="clean">

<delete dir="${build.dir}"/>

</target>

</project>


On Wed, Sep 9, 2009 at 1:08 PM, Avlesh Singh <av...@gmail.com> wrote:

> The classpathref="axis2.classpath" attribute you have used for the javac
> task, needs to be defined prior to using it.
>
> Cheers
> Avlesh
>
> On Wed, Sep 9, 2009 at 9:34 PM, veena pandit <v....@gmail.com> wrote:
>
> >  I have the following in my build.xml, but it complains about an import:
> > *
> >
> > import* org.apache.axis2.util.OptionsParser;
> > I thought this class is part of the axis 2 package.  Can anyone help me
> > fix this?
> >
> > Thanks,
> >
> > Sonia
> >
> >
> > <target name="compile.service">
> >
> > <mkdir dir="${build.dir}"/>
> >
> > <mkdir dir="${build.dir}/classes"/>
> >
> > <!--First let's compile the classes-->
> >
> > <javac debug="on"
> >
> > fork="true"
> >
> > destdir="${build.dir}/classes"
> >
> > srcdir="${basedir}/src"
> >
> > classpathref="axis2.classpath">
> >
> > <classpath>
> >
> > <fileset dir="lib">
> >
> > <include name="**.jar"/>
> >
> > </fileset>
> >
> > </classpath>
> >
> > </javac>
> >
> > </target>
> >
>

Re: path problems in build.xml

Posted by Avlesh Singh <av...@gmail.com>.
The classpathref="axis2.classpath" attribute you have used for the javac
task, needs to be defined prior to using it.

Cheers
Avlesh

On Wed, Sep 9, 2009 at 9:34 PM, veena pandit <v....@gmail.com> wrote:

>  I have the following in my build.xml, but it complains about an import:
> *
>
> import* org.apache.axis2.util.OptionsParser;
> I thought this class is part of the axis 2 package.  Can anyone help me
> fix this?
>
> Thanks,
>
> Sonia
>
>
> <target name="compile.service">
>
> <mkdir dir="${build.dir}"/>
>
> <mkdir dir="${build.dir}/classes"/>
>
> <!--First let's compile the classes-->
>
> <javac debug="on"
>
> fork="true"
>
> destdir="${build.dir}/classes"
>
> srcdir="${basedir}/src"
>
> classpathref="axis2.classpath">
>
> <classpath>
>
> <fileset dir="lib">
>
> <include name="**.jar"/>
>
> </fileset>
>
> </classpath>
>
> </javac>
>
> </target>
>