[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Finally, A Question! Ant classpath issues  XML
Forum Index » Java Programming
Author Message
tfecw

Newbie

Joined: 09/19/2005 15:02:20
Messages: 144
Location: No. VA.
Offline

Finally my build is over with, well we deploy tomorrow so now I have some time to play around with all the neat tools that i've put on the to-do list.


First up, ant.

I was playing around with it, and it seems pretty straight forward. I did run into a problem with using the <classpath> option as in...



Note: i tried doing it both ways Inlining, and umm not inlining. (i am aware that ant has junit tags to do stuff for me, I'll get to it eventually)

basically it gives me an error and some things to try and ant tells me to not submit a bug report.

This is what it looks like:

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
- You have misspelt 'classpath'.
Fix: check your spelling.
- The task needs an external JAR file to execute
and this is not found at the right place in the classpath.
Fix: check the documentation for dependencies.
Fix: declare the task.
- The task is an Ant optional task and the JAR file and/or libraries
implementing the functionality were not found at the time you
yourself built your installation of Ant from the Ant sources.
Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
task and make sure it contains more than merely a META-INF/MANIFEST.MF.
If all it contains is the manifest, then rebuild Ant with the needed
libraries present in ${ant.home}/lib/optional/ , or alternatively,
download a pre-built release version from apache.org
- The build file was written for a later version of Ant
Fix: upgrade to at least the latest release version of Ant
- The task is not an Ant core or optional task
and needs to be declared using <taskdef>.
- You are attempting to use a task defined using
<presetdef> or <macrodef> but have spelt wrong or not
defined it at the point of use

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.



Long story short I don't know what it's asking for, or telling me what to do. (other than don't submit a bug report)

The help at the Ant site here Didn't have too much to say. Something about classloaders and I think it's suggesting that I put all my jars in the ANT_HOME/lib directory.
The faq says to use the -lib switch on startup but that seems to disable which target I can pick.

IE



The help item also seems to be directly related to not finding the <junit> or the <style> tags not the <classpath> tag. It seems like it's hanging on the classpath tag, considering I'm not using the style or junit tags.

I know there are a couple of workarounds, The most obvious being a .cmd command to set the classpath and I can then go about using ANT from there. I can also set all this stuff into the environment, but that gets messy.

Any ideas on how to work around this? Am i missing something?
aim icon
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 751
Location: Superior, CO, USA
Offline

You want to set the classpath as a child of javac:



Also, do you mean to have just a directory as the pathelement? Normally it'll be something more like:



Lastly, ant and Java prefer forward slashes even in Windows. The backslash tend to be escape characters and can confuse things.

This message was edited 1 time. Last update was at 09/30/2005 21:37:08


Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
tfecw

Newbie

Joined: 09/19/2005 15:02:20
Messages: 144
Location: No. VA.
Offline

Ahh very cool.

Forward slashes...check.

As for the directory I just tossed in "c:\files" to make sure that junit wasn't interfering with anything. (silly I know, there was no real logic thought behind the maneuver)

Thanks for the help! I guess my tutorial failed to mention that classpath needed to be a child of javac. That or I failed to actually read the words instead of looking at the examples, which I’ve been guilt of many times. I'm not set up at home yet, but I'll give it a shot later tonight or tomorrow.

aim icon
 
Forum Index » Java Programming
Go to:   
Powered by JForum 2.1.8 © JForum Team
This site built by Scott Dunbar of Xigole Systems. © 2005-2010 - Scott Dunbar
Java and the Java Get Powered logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
hotjoe.com and xigole.com have no affiliation with Sun Microsystems, Inc.