Hi, I need to run .BAT file from Java application. here is the code I am following: class test....{ try{ Runtime.getRuntime().exec("Jtier.BAT"); }catch.. There are three commands to execute in the .Bat file SET PATH=%PATH%;C:\j2sdk1.4.0\bin; SET CLASSPATH=.;C:\j2sdk1.4.0\classes;C:\j2sdk1.4.0;C:\mq.jar; java Jtier
But it dosent work. It dosent execute hte JTier application, when I run test java program. But when I change the code as: class test....{ try.. Runtime.getRuntime().exec("java Jtier"); }catch.. It works. Please help me to understand how it works. Does my .bat file should have only one command to execute? Can this not execute mulitple commands? Please let me know. Thanks, Manoj
Manoj<br />SCJP, SCJD, SCWCD, IBM WSAD.
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18670
posted
0
Does this have something to do with the Developer Certification exam? I think you probably want to post this in another forum, such as Java in General (Intermediate). If you're using a BAT file as part of your developer exam, your code is very unlikely to run on other machines (esp non-Wndows machines).
"I'm not back." - Bill Harding, Twister
Andrew Monkhouse
author and jackaroo
Marshal Commander
Since Manoj opened the same question in JiG (Intermediate) following Jim's comment, I have closed this thread. Please post any comments in Manoj's other thread for this question.