File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Running a .exe file from a .java file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Running a .exe file from a .java file" Watch "Running a .exe file from a .java file" New topic
Author

Running a .exe file from a .java file

abinash das
Ranch Hand

Joined: Apr 26, 2008
Posts: 52
I have a scenario like i am having a executable jar file
,i converted it into .exe file .

My requirements.
1:-- To Run that .exe file from a .java file.
2:-- send some values to that .exe file which it will take as
an parameter.

Thanks in advance
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Look at the java.lang.Runtime.exec() family of static methods.


[Jess in Action][AskingGoodQuestions]
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3429
    
  12
Or the ProcessBuilder class if you're running Java 1.5 or later.


Joanne
abinash das
Ranch Hand

Joined: Apr 26, 2008
Posts: 52
Can Any Body send me some codings.
I don't want to hard code my .exe file location inside
exec(-) method.
and more over i want to pass pass some parameters to that .exe file.
can any body suggest me a sample code.


thanks in adv.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3429
    
  12
The Javadoc for ProcessBuilder has an example
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running a .exe file from a .java file
 
Similar Threads
its urgent
Calling .Net exe file from java
Running a .exe from java program
can u help me out
How to Execute a .exe file stored in jar file ?