You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Michael Kuß <mk...@asdis.de> on 2002/12/03 12:08:23 UTC
Setting environment for forked java process on Win XP
hi,
I try to start a java task from ant 1.5.1 on Windows XP.
<java classname="foo.bar" fork="yes">
The Problem is that I need a dll (DLL1) to call some JNI stuff.
This dll needs another dll (DLL2) not located in the PATH environment.
I have tried to modify the PATH for my java task with
<env key="PATH" path="${java.library.path}:${rundir}/Client/lib" />
The DLL2 is located in the ${rundir}/Client/lib directory.
I'm also setting
<sysproperty key="java.library.path"
path="${java.library.path}:${rundir}/Client/lib"/>
If I start the java process the DLL2 will not be found in the PATH
environment. DLL1 is found in the java.library.path. It seems
that the PATH environment is not properly set. ant -v shows
that the PATH environment is set.
I have also tried to use "newenvironment=true" in my java task. That
leaves my program fully useless to network calls. I can't find my
host anymore (gethostbyname() failed: java.net.UnknownHostException).
Can anyone help me out of this?
How do I set the PATH environment properly and/or how do I get
a working environment with newenvironment=true?
Thanx in advance,
Michael
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Setting environment for forked java process on Win XP
Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Michael Kuß" <mk...@asdis.de>
To: <an...@jakarta.apache.org>
Sent: Tuesday, December 03, 2002 3:08 AM
Subject: Setting environment for forked java process on Win XP
> hi,
>
> I try to start a java task from ant 1.5.1 on Windows XP.
>
> <java classname="foo.bar" fork="yes">
>
> The Problem is that I need a dll (DLL1) to call some JNI stuff.
> This dll needs another dll (DLL2) not located in the PATH environment.
modify your code to use LoadLibraryEx() and all you need to do is set the
java.library.path. Easier said than done, though.
> <sysproperty key="java.library.path"
> path="${java.library.path}:${rundir}/Client/lib"/>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>