You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ajay Gautam <aj...@comcast.net> on 2003/04/03 05:47:00 UTC

Eclipse / ant can't find jar file

Hello,

Yesterday, I downloaded and installed Eclipse 2.1 GTK on Gentoo Linux.

I have a CVS repository, which I can connect to and see from the CVS 
view in eclipse. I did "Checkout as Project" on a project, right clicked 
on build.xml and ran the "compile" target. Ant failed:

---------------------------
[javac] /home/agautam/workspace/JmsTcpAdapter/source/JmsEmu.java:6: 
package org.apache.log4j does not exist
[javac] import org.apache.log4j.*;
[javac] ^
---------------------------
and a ton of related errors.


Then, I went to the /tmp directory, and:
$ cvs co JmsTcpAdapter
$ cd JmsTcpAdaper
$ ant

which was successful.

I went back to eclipse, deleted the project, to be on the safe side, and 
re-checkedout the project and did a build again. Again same error. Looks 
like ant is unable to locate the log4j jar file in the lib directory, 
which I verified exists. Here are a few relevant lines from my build.xml:

---------------------------
	<property name="src" location="source"/>
	<property name="build" location="classes"/>
	
	<target name="init">
		<tstamp/>
		<mkdir dir="${build}"/>
	</target>
	
	<path id="project.class.path">
		<pathelement path="${classpath}"/>
		<pathelement location="${build}"/>
		<fileset dir="lib">
			<include name="**/*.jar"/>
		</fileset>
		<fileset dir="jbosslib">
			<include name="**/*.jar"/>
		</fileset>
	</path>
	
	<target name="compile" depends="init">
		<javac srcdir="${src}" destdir="${build}">
			<classpath refid="project.class.path"/>
		</javac>
	</target>
---------------------------

Another strange thing I found was that even from the command line,
$ cd ~/workspace/JmsTcpAdapter
$ ant

fails with the same errors. "cvs diff" does not show anything, and
"cvs up" does not bring anything new.

Any help in getting this project to work in eclipse will be really 
appreciated.

This is my first time I am trying out eclipse, and it really looks 
promising. Thanks for the excellent product guys...

Ajay Gautam


Re: Eclipse / ant can't find jar file

Posted by Ajay Gautam <aj...@comcast.net>.
Ajay Gautam wrote:

> Hello,
>
> Yesterday, I downloaded and installed Eclipse 2.1 GTK on Gentoo Linux.
>
> I have a CVS repository, which I can connect to and see from the CVS 
> view in eclipse. I did "Checkout as Project" on a project, right 
> clicked on build.xml and ran the "compile" target. Ant failed:
>
> ---------------------------
> [javac] /home/agautam/workspace/JmsTcpAdapter/source/JmsEmu.java:6: 
> package org.apache.log4j does not exist
> [javac] import org.apache.log4j.*;
> [javac] ^
> ---------------------------
> and a ton of related errors.
>
>
> Then, I went to the /tmp directory, and:
> $ cvs co JmsTcpAdapter
> $ cd JmsTcpAdaper
> $ ant
>
> which was successful.
>
> I went back to eclipse, deleted the project, to be on the safe side, 
> and re-checkedout the project and did a build again. Again same error. 
> Looks like ant is unable to locate the log4j jar file in the lib 
> directory, which I verified exists. Here are a few relevant lines from 
> my build.xml:
>
> ---------------------------
> <property name="src" location="source"/>
> <property name="build" location="classes"/>
>
> <target name="init">
> <tstamp/>
> <mkdir dir="${build}"/>
> </target>
>
> <path id="project.class.path">
> <pathelement path="${classpath}"/>
> <pathelement location="${build}"/>
> <fileset dir="lib">
> <include name="**/*.jar"/>
> </fileset>
> <fileset dir="jbosslib">
> <include name="**/*.jar"/>
> </fileset>
> </path>
>
> <target name="compile" depends="init">
> <javac srcdir="${src}" destdir="${build}">
> <classpath refid="project.class.path"/>
> </javac>
> </target>
> ---------------------------
>
> Another strange thing I found was that even from the command line,
> $ cd ~/workspace/JmsTcpAdapter
> $ ant
>
> fails with the same errors. "cvs diff" does not show anything, and
> "cvs up" does not bring anything new.
>
> Any help in getting this project to work in eclipse will be really 
> appreciated.
>
> This is my first time I am trying out eclipse, and it really looks 
> promising. Thanks for the excellent product guys...
>
> Ajay Gautam


Verified the same problem on win2k and Mandrake linux laptop.

Looking for solutions....

Thanks

Ajay Gautam



RE: Eclipse / ant can't find jar file

Posted by Ma...@cs.tcd.ie.
Lads,
       Aww them options have made my day!! And the fact that that's made
my day has in fact just ruined it again. 

Seriously though thanks for the options,
Mark.


-----Original Message-----
From: Ajay Gautam [mailto:ajaygautam@comcast.net] 
Sent: 04 April 2003 04:46
To: Ant Users List
Subject: Re: Eclipse / ant can't find jar file

Ilja Preuss wrote:

>Run Ant using the -verbose flag and look out for output from the
fileset
>tasks. If you don't see anything helpfull, try -debug.
>
>Hope this helps...
>
>Ilja
>  
>
Thanks for the flags. Its amazing how I learn something new every damn 
day !!

Anyway, the problem was with cvs. It was screwing the jar file on the
way...

Fixed now, things are looking bright. This worked, VSS worked, cool :)

Thanks once again

Ajay


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


Re: Eclipse / ant can't find jar file

Posted by Ajay Gautam <aj...@comcast.net>.
Ilja Preuss wrote:

>Run Ant using the -verbose flag and look out for output from the fileset
>tasks. If you don't see anything helpfull, try -debug.
>
>Hope this helps...
>
>Ilja
>  
>
Thanks for the flags. Its amazing how I learn something new every damn 
day !!

Anyway, the problem was with cvs. It was screwing the jar file on the way...

Fixed now, things are looking bright. This worked, VSS worked, cool :)

Thanks once again

Ajay


RE: Eclipse / ant can't find jar file

Posted by Ilja Preuss <pr...@disy.net>.
Run Ant using the -verbose flag and look out for output from the fileset
tasks. If you don't see anything helpfull, try -debug.

Hope this helps...

Ilja

> -----Original Message-----
> From: Ajay Gautam [mailto:ajaygautam@comcast.net] 
> Sent: Thursday, April 03, 2003 2:39 PM
> To: Ant Users List
> Subject: Re: Eclipse / ant can't find jar file
> 
> 
> Mark.Gargan@cs.tcd.ie wrote:
> 
> >Hi Ajay,
> > 
> >	I'm not 100% sure on this but try moving the properties 
> for src and 
> >build into the init target along with the path structure and 
> re-running 
> >it. I sometimes had hassle like this. I dunno why though but 
> when I put 
> >it all into the init target i.e. a target that compile
> >directly or indirectly depends on, it works.   
> >
> 
> Tried that, same results. Anything else you could think of ? 
> Personally, 
> I am out of ideas.
> 
> Thanks
> 
> Ajay Gautam
> 
> >
> >-------------------
> >	
> >	
> >	<target name="init">
> >		<tstamp/>
> >		<property name="src" location="source"/>
> >		<property name="build" location="classes"/>
> >
> >		<mkdir dir="${build}"/>
> >
> >		<path id="project.class.path">
> >			<pathelement path="${classpath}"/>
> >			<pathelement location="${build}"/>
> >			<fileset dir="lib">
> >				<include name="**/*.jar"/>
> >			</fileset>
> >			<fileset dir="jbosslib">
> >				<include name="**/*.jar"/>
> >			</fileset>
> >		</path>
> >	</target>
> >	
> >	
> >	
> >	<target name="compile" depends="init">
> >		<javac srcdir="${src}" destdir="${build}">
> >			<classpath refid="project.class.path"/>
> >		</javac>
> >	</target>
> >-------------------
> >
> >
> >Eclipse is a really excellent package from what the what little few 
> >weeks experience I've had with it so I really hope you persevere and 
> >get it to work.
> >
> >Thanks,
> >Mark.
> >
> >-----Original Message-----
> >From: Ajay Gautam [mailto:ajaygautam@comcast.net]
> >Sent: 03 April 2003 04:47
> >To: user@ant.apache.org
> >Subject: Eclipse / ant can't find jar file
> >
> >Hello,
> >
> >Yesterday, I downloaded and installed Eclipse 2.1 GTK on 
> Gentoo Linux.
> >
> >I have a CVS repository, which I can connect to and see from the CVS
> >view in eclipse. I did "Checkout as Project" on a project, 
> right clicked
> >
> >on build.xml and ran the "compile" target. Ant failed:
> >
> >---------------------------
> >[javac] /home/agautam/workspace/JmsTcpAdapter/source/JmsEmu.java:6:
> >package org.apache.log4j does not exist
> >[javac] import org.apache.log4j.*;
> >[javac] ^
> >---------------------------
> >and a ton of related errors.
> >
> >
> >Then, I went to the /tmp directory, and:
> >$ cvs co JmsTcpAdapter
> >$ cd JmsTcpAdaper
> >$ ant
> >
> >which was successful.
> >
> >I went back to eclipse, deleted the project, to be on the safe side, 
> >and
> >
> >re-checkedout the project and did a build again. Again same error. 
> >Looks
> >
> >like ant is unable to locate the log4j jar file in the lib directory,
> >which I verified exists. Here are a few relevant lines from my
> >build.xml:
> >
> >---------------------------
> >	<property name="src" location="source"/>
> >	<property name="build" location="classes"/>
> >	
> >	<target name="init">
> >		<tstamp/>
> >		<mkdir dir="${build}"/>
> >	</target>
> >	
> >	<path id="project.class.path">
> >		<pathelement path="${classpath}"/>
> >		<pathelement location="${build}"/>
> >		<fileset dir="lib">
> >			<include name="**/*.jar"/>
> >		</fileset>
> >		<fileset dir="jbosslib">
> >			<include name="**/*.jar"/>
> >		</fileset>
> >	</path>
> >	
> >	<target name="compile" depends="init">
> >		<javac srcdir="${src}" destdir="${build}">
> >			<classpath refid="project.class.path"/>
> >		</javac>
> >	</target>
> >---------------------------
> >
> >Another strange thing I found was that even from the command 
> line, $ cd 
> >~/workspace/JmsTcpAdapter $ ant
> >
> >fails with the same errors. "cvs diff" does not show 
> anything, and "cvs 
> >up" does not bring anything new.
> >
> >Any help in getting this project to work in eclipse will be really
> >appreciated.
> >
> >This is my first time I am trying out eclipse, and it really looks
> >promising. Thanks for the excellent product guys...
> >
> >Ajay Gautam
> >  
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 


Re: Eclipse / ant can't find jar file

Posted by Ajay Gautam <aj...@comcast.net>.
Mark.Gargan@cs.tcd.ie wrote:

>Hi Ajay,
> 
>	I'm not 100% sure on this but try moving the properties for src
>and build into the init target along with the path structure and
>re-running it. I sometimes had hassle like this. I dunno why though but
>when I put it all into the init target i.e. a target that compile
>directly or indirectly depends on, it works.   
>

Tried that, same results. Anything else you could think of ? Personally, 
I am out of ideas.

Thanks

Ajay Gautam

>
>-------------------
>	
>	
>	<target name="init">
>		<tstamp/>
>		<property name="src" location="source"/>
>		<property name="build" location="classes"/>
>
>		<mkdir dir="${build}"/>
>
>		<path id="project.class.path">
>			<pathelement path="${classpath}"/>
>			<pathelement location="${build}"/>
>			<fileset dir="lib">
>				<include name="**/*.jar"/>
>			</fileset>
>			<fileset dir="jbosslib">
>				<include name="**/*.jar"/>
>			</fileset>
>		</path>
>	</target>
>	
>	
>	
>	<target name="compile" depends="init">
>		<javac srcdir="${src}" destdir="${build}">
>			<classpath refid="project.class.path"/>
>		</javac>
>	</target>
>-------------------
>
>
>Eclipse is a really excellent package from what the what little few
>weeks experience I've had with it so I really hope you persevere and get
>it to work.
>
>Thanks,
>Mark.
>
>-----Original Message-----
>From: Ajay Gautam [mailto:ajaygautam@comcast.net] 
>Sent: 03 April 2003 04:47
>To: user@ant.apache.org
>Subject: Eclipse / ant can't find jar file
>
>Hello,
>
>Yesterday, I downloaded and installed Eclipse 2.1 GTK on Gentoo Linux.
>
>I have a CVS repository, which I can connect to and see from the CVS 
>view in eclipse. I did "Checkout as Project" on a project, right clicked
>
>on build.xml and ran the "compile" target. Ant failed:
>
>---------------------------
>[javac] /home/agautam/workspace/JmsTcpAdapter/source/JmsEmu.java:6: 
>package org.apache.log4j does not exist
>[javac] import org.apache.log4j.*;
>[javac] ^
>---------------------------
>and a ton of related errors.
>
>
>Then, I went to the /tmp directory, and:
>$ cvs co JmsTcpAdapter
>$ cd JmsTcpAdaper
>$ ant
>
>which was successful.
>
>I went back to eclipse, deleted the project, to be on the safe side, and
>
>re-checkedout the project and did a build again. Again same error. Looks
>
>like ant is unable to locate the log4j jar file in the lib directory, 
>which I verified exists. Here are a few relevant lines from my
>build.xml:
>
>---------------------------
>	<property name="src" location="source"/>
>	<property name="build" location="classes"/>
>	
>	<target name="init">
>		<tstamp/>
>		<mkdir dir="${build}"/>
>	</target>
>	
>	<path id="project.class.path">
>		<pathelement path="${classpath}"/>
>		<pathelement location="${build}"/>
>		<fileset dir="lib">
>			<include name="**/*.jar"/>
>		</fileset>
>		<fileset dir="jbosslib">
>			<include name="**/*.jar"/>
>		</fileset>
>	</path>
>	
>	<target name="compile" depends="init">
>		<javac srcdir="${src}" destdir="${build}">
>			<classpath refid="project.class.path"/>
>		</javac>
>	</target>
>---------------------------
>
>Another strange thing I found was that even from the command line,
>$ cd ~/workspace/JmsTcpAdapter
>$ ant
>
>fails with the same errors. "cvs diff" does not show anything, and
>"cvs up" does not bring anything new.
>
>Any help in getting this project to work in eclipse will be really 
>appreciated.
>
>This is my first time I am trying out eclipse, and it really looks 
>promising. Thanks for the excellent product guys...
>
>Ajay Gautam
>  
>



RE: Eclipse / ant can't find jar file

Posted by Ma...@cs.tcd.ie.
Hi Ajay,
 
	I'm not 100% sure on this but try moving the properties for src
and build into the init target along with the path structure and
re-running it. I sometimes had hassle like this. I dunno why though but
when I put it all into the init target i.e. a target that compile
directly or indirectly depends on, it works.   

-------------------
	
	
	<target name="init">
		<tstamp/>
		<property name="src" location="source"/>
		<property name="build" location="classes"/>

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

		<path id="project.class.path">
			<pathelement path="${classpath}"/>
			<pathelement location="${build}"/>
			<fileset dir="lib">
				<include name="**/*.jar"/>
			</fileset>
			<fileset dir="jbosslib">
				<include name="**/*.jar"/>
			</fileset>
		</path>
	</target>
	
	
	
	<target name="compile" depends="init">
		<javac srcdir="${src}" destdir="${build}">
			<classpath refid="project.class.path"/>
		</javac>
	</target>
-------------------


Eclipse is a really excellent package from what the what little few
weeks experience I've had with it so I really hope you persevere and get
it to work.

Thanks,
Mark.

-----Original Message-----
From: Ajay Gautam [mailto:ajaygautam@comcast.net] 
Sent: 03 April 2003 04:47
To: user@ant.apache.org
Subject: Eclipse / ant can't find jar file

Hello,

Yesterday, I downloaded and installed Eclipse 2.1 GTK on Gentoo Linux.

I have a CVS repository, which I can connect to and see from the CVS 
view in eclipse. I did "Checkout as Project" on a project, right clicked

on build.xml and ran the "compile" target. Ant failed:

---------------------------
[javac] /home/agautam/workspace/JmsTcpAdapter/source/JmsEmu.java:6: 
package org.apache.log4j does not exist
[javac] import org.apache.log4j.*;
[javac] ^
---------------------------
and a ton of related errors.


Then, I went to the /tmp directory, and:
$ cvs co JmsTcpAdapter
$ cd JmsTcpAdaper
$ ant

which was successful.

I went back to eclipse, deleted the project, to be on the safe side, and

re-checkedout the project and did a build again. Again same error. Looks

like ant is unable to locate the log4j jar file in the lib directory, 
which I verified exists. Here are a few relevant lines from my
build.xml:

---------------------------
	<property name="src" location="source"/>
	<property name="build" location="classes"/>
	
	<target name="init">
		<tstamp/>
		<mkdir dir="${build}"/>
	</target>
	
	<path id="project.class.path">
		<pathelement path="${classpath}"/>
		<pathelement location="${build}"/>
		<fileset dir="lib">
			<include name="**/*.jar"/>
		</fileset>
		<fileset dir="jbosslib">
			<include name="**/*.jar"/>
		</fileset>
	</path>
	
	<target name="compile" depends="init">
		<javac srcdir="${src}" destdir="${build}">
			<classpath refid="project.class.path"/>
		</javac>
	</target>
---------------------------

Another strange thing I found was that even from the command line,
$ cd ~/workspace/JmsTcpAdapter
$ ant

fails with the same errors. "cvs diff" does not show anything, and
"cvs up" does not bring anything new.

Any help in getting this project to work in eclipse will be really 
appreciated.

This is my first time I am trying out eclipse, and it really looks 
promising. Thanks for the excellent product guys...

Ajay Gautam


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