Monday, May 24, 2010

Java exec() return a following error.?

Runtime run=Runtime.getRuntime();


Process pro=run.exec("D:\\javpro\\test.exe");


BufferedReader read=new BufferedReader(new InputStreamReader(pro.getInputStream()))...


System.out.println(read.readLine());





This is my java program.test.exe working well when run alone.My operating system is window XP. when i execute test.exe through my java program a error dialog box appear with title 16 bit MS-DOS Subsystem and the content is " C:\WINDOWS\system32\ntvdm.exe Error while setting up environment for application."





Please tell solution for clear this problem.

Java exec() return a following error.?
The Java Tutorials are practical guides for programmers who want to use the Java programming language to create applications. They include hundreds of complete, working examples, and dozens of lessons. Groups of related lessons are organized into "trails".


For the most up-to-date version, see http://java.sun.com/docs/books/tutorial.
Reply:my guess, and this is only a guess, is that you're not really supposed to run java programs in the 16 bit world (16 bit is pretty old). Open a command (start=%26gt;run=%26gt;cmd) window and navigate to that directory and run the program from that command line. Cmd is a 32 bit process and should be okay to run your program. another possible problem is that your environment isn't set up correctly and the jre can't find some class it needs. good luck.


No comments:

Post a Comment