How to access Runtime in MAc to launch Java apps from Java applications ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Pradeep_Shekade
Posted On:   Thursday, August 9, 2001 07:29 AM

The following code works for windows and Linux and not for Apple Mac OS X


Runtime runtime = Runtime.getRuntime();

Process process = null;


try

{

process = runtime.exec("javaw -cp myclasses.jar myapp");

}

catch(IOException e){}


What could be the problem ??

Re: How to access Runtime in MAc to launch Java apps from Java applications ?

Posted By:   Christopher_Schultz  
Posted On:   Thursday, August 9, 2001 08:38 AM

(Mac experts, crrect me if I'm wrong).



The Mac works differently from the DOS or UNIX world. Since the Mac is not inherently command-line-based, there's no notion of a "PATH" in which your javaw executable can be found.



You'll have to look on a Mac/Java bulletin board (or wait for an answer from someone here) to get your answer. There's gotta be a way to specify the path to the desired executable on a Mac. Is it not the same way as on UNIX? Try being very specific about the path to javaw, like this:



/Applications/JRE/bin/javaw or wherever your javaw is.



Good luck,

-chris
About | Sitemap | Contact