Discussion:
[daemon] Problem with Working Directory
(too old to reply)
Gil Baruch
2018-03-06 21:07:18 UTC
Permalink
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.
Gary Gregory
2018-03-07 04:34:30 UTC
Permalink
Have you tried using --StartPath? See
https://commons.apache.org/proper/commons-daemon/procrun.html

Gary
Post by Gil Baruch
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.
Gil Baruch
2018-03-08 06:25:54 UTC
Permalink
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.
Post by Gary Gregory
Have you tried using --StartPath? See
https://commons.apache.org/proper/commons-daemon/procrun.html
Gary
Post by Gil Baruch
Seems like I hit a well known issue although I couldn't find
documentation
Post by Gil Baruch
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
Post by Gil Baruch
a change of 'user.dir' system property and instead, the file path would
be
Post by Gil Baruch
constructed out of the actual working directory that the JVM started
from.
Post by Gil Baruch
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.
Loading...