You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ro...@canada.com on 2004/07/13 23:01:41 UTC

CLASSPATH in Java task

Can someone clear up some confusion for me with respect
to the classpath for the Java task in Ant 1.6.1,
running on Windows 2000.

I am trying to execute a Jar file but my Java task
doesn't appear to see the correct classpath. My program
displays the JVM variable "java.class.path" and it is
different than the classpath which the program actually
needs to see.

Here is my desired classpath and my Java task:

<path id="cp" description="classpath for executing
stored procedure clients from jars">
	<fileset dir="d:/sqllib/java">
		<include name="*.zip"/>
		</fileset>
	</path>

<!--Run-->
<target name="Q1_Run" description="Run the client.">
<java jar="${jar.dir}/${Question1.jar}" fork="true">
        <classpath refid="cp"/>
        </java>
</target>

My Classpath environment variable is set to
D:\sqllib\java\db2java.zip.

Despite the value of my classpath environment variable
and the classpath value I am setting in the java task,
the program itself displays 

CLASSPATH=D:\rds\jar\Income.jar

then fails because it is not able to load the JDBC
driver my program needs; this JDBC driver is in
d:\sqllib\java\db2java.zip, which appears in both my
classpath environment variable and my Java task.

I am completely baffled by this; I thought that the
Java task would use the classpath environment variable
if I didn't pass a specific classpath to the task.
Failing that, I assumed that if I specified the desired
classpath, that is what would be used. Instead, the
Java task seems to ignore BOTH the environment variable
AND the specified classpath. (For what it's worth, I've
tried coding the specific classpath three different
ways: none of the three ways produced an error message 
but none of them worked either.)

Can anyone tell me what I need to do to make the Java
task see the classpath I want so that my program runs?

I really need some help here; I've been banging my head
against the wall over this for hours.

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


Re: Ant+xslt question

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
I am doing something like that, but not with XSLT. I have written a 
Jython (Java Python) script to generate ANT build files. Using a Java 
based scripting language does not add new requirements (Jython is just a 
Jar file + modules). Before that I was using Perl, but it would require 
every build computer to have Perl installed.

- Alexey.

Chris wrote:

>I just had a quick conceptual question for those with experience using
>XSLT to generate Ant build files.  I have an application that is created
>from a handful of different projects that all have similar build files.
>Is the general idea to run my configuration xml file through a
>translation to get a generic build file and then pipe that output
>through smaller translations for each particular project to change
>anything that is particular to a project?  I just want to make sure I'm
>thinking about this the right way and not missing something that might
>be simpler.
>
>Thanks!
>C
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.716 / Virus Database: 472 - Release Date: 7/5/2004
> 
>
>
>---------------------------------------------------------------------
>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


Ant+xslt question

Posted by Chris <ct...@virginia.edu>.
I just had a quick conceptual question for those with experience using
XSLT to generate Ant build files.  I have an application that is created
from a handful of different projects that all have similar build files.
Is the general idea to run my configuration xml file through a
translation to get a generic build file and then pipe that output
through smaller translations for each particular project to change
anything that is particular to a project?  I just want to make sure I'm
thinking about this the right way and not missing something that might
be simpler.

Thanks!
C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 7/5/2004
 


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