This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes a bug in the Runtime class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "a bug in the Runtime class" Watch "a bug in the Runtime class" New topic
Author

a bug in the Runtime class

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
[code]
public class Test{
public static void main(String args[])throws Exception {
Runtime rt=Runtime.getRuntime();
Process p=rt.exec("java Test");
System.out.println("asdasdada");
System.out.println(p.waitFor());

}
}
[\code]
here i am running the same file being inside the same file...
but it is unable to run new program..
can any one tell me why it is unable to run a program in loop form


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
It's hard to say what's going on since you don't mention what is going on (just that something doesn't work), but -as this article explains- you may need to use the full path of the "java" executable, and you probably need to handle the output that the child process generates.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a bug in the Runtime class
 
Similar Threads
files with no public classes...
get fooled with this programs
Copying file from one PC to the other PC on a network.
Set environment variable of UNIX by java program
Object Creation