You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Allen, Michael B (RSCH)" <Mi...@ml.com> on 2000/07/04 05:28:11 UTC
the java task
Hello,
I'm having a little trouble with the java task. If I have a target like
below it doesn't work:
86 <target name="run_http">
87 <java classname="com.sun.jini.tool.ClassServer"
88 fork="no"
89 jvmargs=""
90 classpath="lib/jini1_0_1/lib/tools.jar"
91 args="-dir ${codebase.dir} -port ${codebase.port}"/>
92 </target>
[miallen@prodlinux swooshmail]$ ./bin/build run_http
Buildfile: etc/build.xml
Project base dir set to: /home/miallen/NYU/vjkproj/swooshmail
Executing Target: run_http
BUILD FATAL ERROR
etc/build.xml:91: Could not find com.sun.jini.tool.ClassServer. Make sure
you have it in your classpath
[miallen@prodlinux swooshmail]$ ls lib/jini1_0_1/lib/
jini-core.jar jini-examples.jar mahalo-dl.jar reggie-dl.jar
sun-util.jar
jini-examples-dl.jar jini-ext.jar mahalo.jar reggie.jar
tools.jar
[miallen@prodlinux swooshmail]$ echo $CLASSPATH
/usr/local/javalibs/classes111.zip
But if I change fork="yes" then it does work. So I gather the classpath
attribute really has no effect if fork="no" just like the jvm and jvmargs
attributes ehh?
Thanks,
Michael B. Allen
Michael_B_Allen@ml.com
http://jcifs.samba.org - MS Windows File and Print Sharing API in 100% Java
Re: the java task
Posted by Ken Wood <kw...@i2.com>.
That is correct - the classpath in effect at the time you
do a java task with fork="no" is the classpath that
Ant was invoked with. You are just running your task
within the JVM that is running ant. But if you set fork="yes"
then you are starting a new JVM with the specified args and
classpath.
"Allen, Michael B (RSCH)" wrote:
> Hello,
>
> I'm having a little trouble with the java task. If I have a target like
> below it doesn't work:
>
> 86 <target name="run_http">
> 87 <java classname="com.sun.jini.tool.ClassServer"
> 88 fork="no"
> 89 jvmargs=""
> 90 classpath="lib/jini1_0_1/lib/tools.jar"
> 91 args="-dir ${codebase.dir} -port ${codebase.port}"/>
> 92 </target>
>
> [miallen@prodlinux swooshmail]$ ./bin/build run_http
> Buildfile: etc/build.xml
> Project base dir set to: /home/miallen/NYU/vjkproj/swooshmail
> Executing Target: run_http
>
> BUILD FATAL ERROR
>
> etc/build.xml:91: Could not find com.sun.jini.tool.ClassServer. Make sure
> you have it in your classpath
>
> [miallen@prodlinux swooshmail]$ ls lib/jini1_0_1/lib/
> jini-core.jar jini-examples.jar mahalo-dl.jar reggie-dl.jar
> sun-util.jar
> jini-examples-dl.jar jini-ext.jar mahalo.jar reggie.jar
> tools.jar
> [miallen@prodlinux swooshmail]$ echo $CLASSPATH
> /usr/local/javalibs/classes111.zip
>
> But if I change fork="yes" then it does work. So I gather the classpath
> attribute really has no effect if fork="no" just like the jvm and jvmargs
> attributes ehh?
>
> Thanks,
>
> Michael B. Allen
> Michael_B_Allen@ml.com
> http://jcifs.samba.org - MS Windows File and Print Sharing API in 100% Java