Hi,

We have a project (Cytoscape) that uses Karaf as its shell for launching
OSGi bundles. Anyway, when Karaf is started using the provided script
(framework/bin/karaf and karaf.bat) we've noticed the working directory is
changed to karaf.base before the JVM is invoked. This is done using the
following line towards the end of the script:

cd "$KARAF_BASE"

Is this necessary for the proper operation of Karaf? We have several bundles
that read arguments from the command line, some of which can be paths to
local files. If a relative path is specified in one of these arguments, we'd
want to look in the directory Karaf is invoked from for this file. This
doesn't work with Karaf changing the directory - however, if we modify our
custom Karaf distribution to not change the directory before executing, our
bundles can reference relative paths from user-provided arguments in the way
we'd expect. 

Obviously, everything works fine if you specify absolute paths, but that is
undesirable for end users. And tracking the directory in our own environment
variable and passing it in to every File constructor would get tedious.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Java-working-directory-relative-file-paths-and-Karaf-tp4035678.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to