Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Run another program from Java

Posted on 2002-07-10
2
Medium Priority
?
153 Views
Last Modified: 2010-03-31
I want to launch a .EXE with arguments from Java.

How ?

Thanks.
0
Comment
Question by:greisch
  • 2
2 Comments
 
LVL 9

Expert Comment

by:Venci75
ID: 7145356
use
Runtime.getRuntime().exec()
0
 
LVL 9

Accepted Solution

by:
Venci75 earned 200 total points
ID: 7145361
you can use for example:
Runtime.getRuntime().exec("prog.exe param1 param2 param3");

or
String[] cmd = new String[3];
cmd[0] = "prog.exe";
cmd[1] = "param1";
cmd[2] = "param2";
Runtime.getRuntime().exec(cmd);
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

772 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