如何解决在java中CreateProcess出现异常的问题?
如何解决在java中CreateProcess出现异常的问题?
在java中调用外部程序时,出现类似这样的异常:
---------- java ----------
java.io.IOException: CreateProcess: C:/j2sdk1.4.2_04/bin/javac error=267
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:428)
at CodeCompiler.main(CodeCompiler.java:15)
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:428)
at CodeCompiler.main(CodeCompiler.java:15)
由于是在创建进程时才出现的,可以判断是调用程序时windows本身报出的,google搜索windows,对应原因描述:
ERROR_DIRECTORY
267 The directory name is invalid.
267 The directory name is invalid.
其他出现的错误码参见完整的错误码列表:
Windows MSDN上:System Error Codes
或
Windows API Guide Error Codes.txt.html