Name: dm26566 Date: 04/16/98
It is impossible to write a application launcher
in 100% pure java. Many external programs
require the current working directory to be
set to something specific. Currently, the only
way to accomplish is to create a proprietary
native library.
Java should have a function such as:
Runtime.exec(String cmd[], String env[], File cwd)
which uses cwd as the working directory for the
new process.
(Review ID: 28456)
======================================================================
phil.race@eng 1998-04-17
An API call like
public Process exec(String cmdarray[],
String envp[],
File directory) throws IOException, FileNotFoundException
would be pretty easy to implement I think
On Solaris this can be implemented by doing a chdir() after the fork()
and before the exec()
On win32 the CreateProcess() system call takes an optional parameter
to set the working directory.
Implementing this would probably answer the needs of at least some
of the requestors of the more contentiosu RFE 4045688
======================================================================
- duplicates
-
JDK-4081777 (process) RFE: Would like to be able to set CWD for Runtime.exec'd() command
- Closed