Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

classpath env and Runtime "exec"

Thread view: 
syvertsj@gmail.com - 24 Apr 2006 16:59 GMT
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[i] = 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
Eric Sosman - 24 Apr 2006 17:21 GMT
syvertsj@gmail.com wrote On 04/24/06 11:59,:
> hello!
> I am trying to work with a java application (which is not our source
[quoted text clipped - 12 lines]
> entire classpath explicitly written. The classpath is not inherited
> from the root process.

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

Signature

Eric.Sosman@sun.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.