• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Help for getting output of Runtime.getRuntime().exec()  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have executed the following command to compile a java program.
Runtime.getRuntime().exec("cmd/c start C:/jdk1.4/BIN/javac filename.java");
i got the class files if there is no errors. But I want to read the errorlist if there any.
My code is like this Anyone can help me please.



thanks in advance
 
Rancher
Posts: 42973
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to read in this article to learn about all the issues you need to be aware of when dealing with Runtime.exec.
 
Marshal
Posts: 60791
190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use the CODE button, and maintain indentation.

Use of Runtime.exec() is slightly easier since the introduction of the ProcessBuilder class, but nobody should go near Runtime.exec() without reading the article Ulf quoted.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!