The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

java getRunTime.exec( ) function

Posted by Jane on May 02, 2001 at 5:38 PM

Hi everyone,

I am trying to use java Runtime function to open vi editor, I used the
following program:

import java.io.*;

public class viTest
{
public static void main(String args[])
{
Process theProcess = null;
System.out.println("viTest.main() invoked");

try
{
theProcess = Runtime.getRuntime().exec("vi");
}
catch(IOException e)
{
System.err.println("Error on exec() method");
e.printStackTrace();
}
} // end method
} // end class

It doesn't work. But if I replace "vi" with "emacs", it works. Does
anyone knows what's the problem? Thanks



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us