File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Path setting problem in java task Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Path setting problem in java task" Watch "Path setting problem in java task" New topic
Author

Path setting problem in java task

J J Singh
Greenhorn

Joined: Mar 20, 2010
Posts: 12
Hi i am using the following code



and my javac target is



I get the message that path variable org.compile.classpath is not set when i try to run this. Can you please point out what is the mistake.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

Welcome to CodeRanch

There are many ways to do this, one way would be to refer the path to jar files in classpath of the javac task.

Then use this as a refid to the classpath


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
J J Singh
Greenhorn

Joined: Mar 20, 2010
Posts: 12
Thank You , classpath is working now.

I have following problem further.

I am using Ant 1.8.2 and Junit 4.8

My build file is



When i run this from Eclipse it runs fine.

When i try to run it using Ant outside eclipse it gives error as Failed

The targets are clean , init ,compile.org , compile.test , testing.junit

When i run clean , init , compile.org and comiple.test from ant it runs fine. But when i run the testing.junit inside ant it gives error as




My code for Calculator.java and its test class CalculatorTest.java is




CalculatorTest.java





Thanks once again in advance
Mark Kin
Greenhorn

Joined: Jun 20, 2009
Posts: 5
Did you figure this out ? I have the same issue.
 
Don't get me started about those stupid light bulbs.
 
subject: Path setting problem in java task
 
Similar Threads
Ant Build Failing -- Need a way to pick jar file during run time.
Install task cannot find file
Unable to compile java file through ant
add classpath to eclips
ant exception