You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Gil Baruch <gi...@gmail.com> on 2018/03/06 21:07:18 UTC

[daemon] Problem with Working Directory

Seems like I hit a well known issue although I couldn't find documentation
about it in the FAQ (unfortunately).

It seems that Java does not fully support changing the working directory
(AKA system property 'user.dir').

Some functionality, such as new File(relativePath) will not be affected by
a change of 'user.dir' system property and instead, the file path would be
constructed out of the actual working directory that the JVM started from.

However, when using the Daemon, I cannot specify the directory from where
to perform the execution of the JVM...

what am I missing?

thanks,
GBa.

Re: [daemon] Problem with Working Directory

Posted by Gil Baruch <gi...@gmail.com>.
OMG, was looking for it for so long... no idea how I missed it, I went over
this page at least 5 times...

thanks a lot, worked flawlessly!
GBa.



On Wed, Mar 7, 2018 at 6:34 AM, Gary Gregory <ga...@gmail.com> wrote:

> Have you tried using --StartPath? See
> https://commons.apache.org/proper/commons-daemon/procrun.html
>
> Gary
>
> On Tue, Mar 6, 2018 at 2:07 PM, Gil Baruch <gi...@gmail.com>
> wrote:
>
> > Seems like I hit a well known issue although I couldn't find
> documentation
> > about it in the FAQ (unfortunately).
> >
> > It seems that Java does not fully support changing the working directory
> > (AKA system property 'user.dir').
> >
> > Some functionality, such as new File(relativePath) will not be affected
> by
> > a change of 'user.dir' system property and instead, the file path would
> be
> > constructed out of the actual working directory that the JVM started
> from.
> >
> > However, when using the Daemon, I cannot specify the directory from where
> > to perform the execution of the JVM...
> >
> > what am I missing?
> >
> > thanks,
> > GBa.
> >
>

Re: [daemon] Problem with Working Directory

Posted by Gary Gregory <ga...@gmail.com>.
Have you tried using --StartPath? See
https://commons.apache.org/proper/commons-daemon/procrun.html

Gary

On Tue, Mar 6, 2018 at 2:07 PM, Gil Baruch <gi...@gmail.com> wrote:

> Seems like I hit a well known issue although I couldn't find documentation
> about it in the FAQ (unfortunately).
>
> It seems that Java does not fully support changing the working directory
> (AKA system property 'user.dir').
>
> Some functionality, such as new File(relativePath) will not be affected by
> a change of 'user.dir' system property and instead, the file path would be
> constructed out of the actual working directory that the JVM started from.
>
> However, when using the Daemon, I cannot specify the directory from where
> to perform the execution of the JVM...
>
> what am I missing?
>
> thanks,
> GBa.
>