D
Dave Rudolf
Hey all,
I am writing a java program that is really a front-end to a handful of other
programs, each in a different location of a directory tree. Some of the
programs have data files that they look for w.r.t. their current directory.
Now, when I call
Runtime.exec( "some_dir\\some_program.exe" );
it starts the program, but has it running from whatever the java program's
current directory is. Thus, the programs can't find the data files that they need.
So, I can get the current directory by doing
System.getProperty( "user.dir" );
But, apparently I can't just do
System.setProperty( "user.dir", "some_dir" );
It seems that doing so changes the system property at least as far as the
property map is concerned, but it does not affect the actual working directory.
So, how might I actually get the thing to change directories?
Thanks.
Dave
I am writing a java program that is really a front-end to a handful of other
programs, each in a different location of a directory tree. Some of the
programs have data files that they look for w.r.t. their current directory.
Now, when I call
Runtime.exec( "some_dir\\some_program.exe" );
it starts the program, but has it running from whatever the java program's
current directory is. Thus, the programs can't find the data files that they need.
So, I can get the current directory by doing
System.getProperty( "user.dir" );
But, apparently I can't just do
System.setProperty( "user.dir", "some_dir" );
It seems that doing so changes the system property at least as far as the
property map is concerned, but it does not affect the actual working directory.
So, how might I actually get the thing to change directories?
Thanks.
Dave