classpath env and Runtime "exec"

S

syvertsj

hello!
I am trying to work with a java application (which is not our source
code) which has a root java process, which 'exec-s' more java
processes. The main app reads a text file with the command line
arguments and uses the Runtime class to exec the new java processes
like the following:

proc = Runtime.getRuntime().exec(inputString(i),null,null);

The "root" java process has a main method of course, as does the
"exec-ed" processes. Both classes extend JFrame.
The startup script sets the classpath explicity, however, the "exec-ed"
processes will not run without the classpath being set explicitly,
meaning, I can only run them using the '-cp' switch and having the
entire classpath explicitly written. The classpath is not inherited
from the root process.
What is wrong here? Does "-cp" work differently when a java process is
exec-ed?
Much thanks.
- Jim
 
E

Eric Sosman

hello!
I am trying to work with a java application (which is not our source
code) which has a root java process, which 'exec-s' more java
processes. The main app reads a text file with the command line
arguments and uses the Runtime class to exec the new java processes
like the following:

proc = Runtime.getRuntime().exec(inputString(i),null,null);

The "root" java process has a main method of course, as does the
"exec-ed" processes. Both classes extend JFrame.
The startup script sets the classpath explicity, however, the "exec-ed"
processes will not run without the classpath being set explicitly,
meaning, I can only run them using the '-cp' switch and having the
entire classpath explicitly written. The classpath is not inherited
from the root process.


Perhaps because you've given the new process a `null'
environment?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top