Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Runtime.getRunTime().exec() failing
Runtime.getRunTime().exec() failing [message #306754] Fri, 04 August 2006 05:36 Go to next message
Eclipse UserFriend
Hello everyone,

My intention is to open external files through code. The editor can be
eclipse's one or external application registered with it at OS level.

I have tried 2 methods. The first method is

1) Using the code in openExternalFileAction() and all the other files it
uses. The error says "TextEditor doesn't have a document provider". I put
a extension for FileDocumentProvider and registered the Default TextEditor
with it but it's still not budging. I feel I've done something wrong in
this step.

The second methid is

2)Using the Runtime class. I used the following code to open "temp.doc"

Process process = Runtime.getRuntime().exec("C:\temp\temp.doc");

It's unable to create a process. The code is failing here also else it
would've been an easier way to do.

Please give a pointer to the problem. I would greatly appreciate it. I've
been reading all the forums but still didn't get any correct way.

Thanks in advance,
Sushma
Re: Runtime.getRunTime().exec() failing [message #306756 is a reply to message #306754] Fri, 04 August 2006 05:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ahmedlazreg.free.fr

if you are under WIN XP/2000/NT platform try
Process process = Runtime.getRuntime().exec("cmd C:\temp\temp.doc");

Best regards
A.Lazreg

"Sushma" <sushma.shinde@gmail.com> a
Re: Runtime.getRunTime().exec() failing [message #306758 is a reply to message #306756] Fri, 04 August 2006 06:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I've tried it. It created the process this time but the doc file didn't
open. there's no error printed in the log.

I confirmed if the process is created or not by printing the exit value.
It said "The process has not exited yet"

Thanks,
Sushma
Re: Runtime.getRunTime().exec() failing [message #306760 is a reply to message #306758] Fri, 04 August 2006 06:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

It should be "cmd /c file.doc"

try typing cmd /? from the command line...

---
Derek

Sushma wrote:
> Hi,
>
> I've tried it. It created the process this time but the doc file didn't
> open. there's no error printed in the log.
> I confirmed if the process is created or not by printing the exit value.
> It said "The process has not exited yet"
>
> Thanks,
> Sushma
>
Re: Runtime.getRunTime().exec() failing [message #306771 is a reply to message #306760] Fri, 04 August 2006 09:07 Go to previous message
Eclipse UserFriend
Hi Derek,

It worked this time!! Works like a charm!!

Thanks a lot!! :-D

Sushma
Previous Topic:Changing configuration of Eclipse FTP plugin
Next Topic:Launch Config and Process mystery
Goto Forum:
  


Current Time: Wed Aug 27 10:47:40 EDT 2025

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

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

Back to the top