?
Solved

Output commands to the System

Posted on 2003-02-21
2
Medium Priority
?
158 Views
Last Modified: 2010-03-31
Hi, i'm just starting out with java,

            Is there a way to output commands to the Terminal window (for UNIX) or to MSDOS prompt (for using windows) from within a java program ?
i talking about commands like :
"cd Java/Programs"
or
"javac HelloWorld.java"
0
Comment
Question by:4mod3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 7995485
0
 

Accepted Solution

by:
vamshicheruku earned 150 total points
ID: 7995541

String cmd="cd Java/Programs";
Runtime r = Runtime.getRuntime().exec(cmd);

regards,
vamshi
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question