Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Shell commands from within RCP
Shell commands from within RCP [message #448978] Mon, 08 May 2006 09:28 Go to next message
Eclipse UserFriend
Hi,

From within my RCP-app I'd like to execute a shell command similar to:

Runtime.getRuntime().exec(MyCommand);

but retrieve the results/output so I can display them for the user, and
also catch when returned from the external command.

Anyone that can give me a hint on how to achieve that?

Cheers,

.../Ola
Re: Shell commands from within RCP [message #448980 is a reply to message #448978] Mon, 08 May 2006 09:53 Go to previous messageGo to next message
Eclipse UserFriend
Maybe this class would help?
http://www.javalobby.org/java/forums/t53333.html
Re: Shell commands from within RCP [message #449070 is a reply to message #448978] Wed, 10 May 2006 05:53 Go to previous messageGo to next message
Eclipse UserFriend
The return type of Runtime.getRuntime().exec() is a Process object, from which you can get back the input/output streams

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Process.ht ml#getOutputStream()

What you do with that is up to you :-)

You could also look at the ConsoleView; it's possible to create your own console if you need to manipulate the results further.

Alex.
Re: Shell commands from within RCP [message #449084 is a reply to message #448978] Wed, 10 May 2006 07:14 Go to previous message
Eclipse UserFriend
Try this example from a german book !

Listening 8.9 <i>ExecDir.java</i> from
http://www.galileocomputing.de/openbook/javainsel5/javainsel 08_004.htm#Rxx747java080040400029D1F034106


It uses the Process Builder available since Java 1.5.0 !
Previous Topic:Any info on writing Ant scripts to build and package RCP applns.?
Next Topic:Using Hibernate AND letting the user select the JDBC-Driver?
Goto Forum:
  


Current Time: Sun Aug 31 04:48:28 EDT 2025

Powered by FUDForum. Page generated in 0.01999 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top