Perry Smith

Java Questions & Answers

Home / Java Q & A Page 2 / Java Q & A Archive Main Page

9-29-98

Call application

Dear sir,
Does I call other program/application in my java application? I'm looking for your reply. Eric Chan

Eric Chan


Response
9-29-98

Re: Call application

Supposedly you can run other command-line executables using the java.lang.Process class .. but it works better when executed in Unix systems than on DOS/Windows. I personally have only gotten it to execute the "dir" command in DOS using:

Process pr1 = Runtime.getRuntime().exec("command.com /c dir");

everything else I tried to run failed miserably with an java.io.IOException, including batch files, and Windows Notepad.

MikeD


9-29-98

Re: Re: Call application

...by the way ... this is the very same problem I was trying to get an an answer to when I discovered this web site a month and a half ago .... I still haven't gotten anything to work, on a Windows platform, from any suggestions from the newsgroups, various chat rooms, "Ask the Java Pro", and, unfortunately, not even this message board. :-( ... Consequently, that project died.

MikeD


10-27-98

Re: Call application

The problem is, that Java does'n understand character like '\', which DOS/Windows users to locate or change directories. It'll works, if you run your class-files in the same directory with the file you want to execute.Or if you set PATH to the file you want to execute in your autoexec.bat.

CCQ


Home / Java Q & A Page 2 / Java Q & A Archive Main Page