ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tek1 <t...@pobox.com>
Subject Re: custom ant task can't find classpath
Date Tue, 09 Apr 2002 03:59:37 GMT
At 09:40 02/04/09 +1000, you wrote:

>Hi,
>
>It's kinda hard to figure out what's going wrong without seeing your code.
>Using ExecuteJava is pretty straight-forward, though - you should be doing
>something like this in your task:
>
>public void execute()
>{
>     Path classpath = new Path( getProject() );
>     classpath.setLocation( helperJarFile );

i tried:

Commandline cmdline = new Commandline();

Path p = cmdline.createClasspath( getProject() );
p.setLocation( helperJarFile );

  this, but when i print out the parameters that are being used for the 
command line, the classpath appears to be null.  as a result, i'm setting 
the classpath by doing the following:

cmdline.createArgument().setValue("-classpath");
cmdline.createArgument().setValue(absolutePathToJarFile);

everything else is the same.  i will try your suggestion for setting the 
classpath.

thank you.



>     Commandline cmdline = new Commandline();
>     cmdline.setExecutable( "Help" );
>     cmdline.createArgument().setValue( param1 );
>
>     ExecuteJava exe = new ExecuteJava();
>     exe.setCommandline( cmdline );
>     exe.setClasspath( classpath );
>
>     exe.execute( getProject() );
>}


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


Mime
View raw message