Bookmark Topic Watch Topic
  • New Topic

exec a java program under linux  RSS feed

 
Gizzmo Zeuzere
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello, I want to run java program in a java program. When i do this :
Process p = Runtime.getRuntime().exec(jav);
try{
p.waitFor();}
catch(InterruptedException ire){}
InputStream is = p.getErrorStream();
BufferedReader br =new BufferedReader(new InputStreamReader(is));
while(br.readLine() != null)
{ agl.console.append(br.readLine()); }
}
catch(IOException ioe){}
where jav="java prog"
It works under windows but not under linux, i don't understand. Can anybody helps me
?
 
Amit Lal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
try and specify the complete path name.. along with it you might want to wrap it in shell script to set the required environment.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post duplicate posts in different forums. Followups can go here.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!