comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Call IDL (Virtual Machine) Save file from Java
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Call IDL (Virtual Machine) Save file from Java [message #55828 is a reply to message #55817] Tue, 11 September 2007 07:55 Go to previous messageGo to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
raval.chintan@gmail.com wrote:

> Hi,
>
> I made one application for which some part I have developed in IDL.
> For this application I made save file in IDL which run correctly If I
> run it through command prompt on Windows with the command given below.
>
> idlrt -vm "D:\myapp.sav"
>
> I made a bat file simple.bat. which contain the same above command.
> When I run this bat file from the command prompt my application is
> running fine.
>
>
> The entire application is in Java. I have only installed IDL virtual
> machine on my Windows XP machine. and I have written following code in
> Java to call the application.
>
>
> Runtime r=Runtime.getRuntime();
> Process p=null;
> try
> {
> String s="D://simple.bat";
>
> p=r.exec(s);
> }
>
> catch(Exception e){
> System.out.println("error==="+e.getMessage());
> e.printStackTrace();
> }
>
> But the problem comes when I try to run the code from Java file. I am
> not able to run IDL application. At the same time one good thing I
> found in above code , It is not generating any error :-).
>
>
> Appriciate If you could help me in this regard.
>
> -Chintan

You can't execute a bat file directly, it needs cmd.exe to run it. Modify your
Java to use the alternative exec() method which takes a String[]:

String[] s = new String[] { "cmd.exe", "D:/simple.bat" };

You may or may not need the /c flag, I don't know cmd.exe well enough to say. If
you do just add it to the array:

String[] s = new String[] { "cmd.exe", "/c", "D:/simple.bat" };

P.S.
You should only need a single "/" in the path, it's "\" which needs to be
escaped by "\".

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Ambiguous keyword abbreviation error
Next Topic: array operations

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 15 13:47:33 PDT 2025

Total time taken to generate the page: 0.71993 seconds