在java中CreateProcess出现的异常的处理(备忘)

来源:互联网 发布:产品经理必备软件 编辑:程序博客网 时间:2024/06/05 17:47
在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)
 
由于是在创建进程时才出现的,可以判断是调用程序时windows本身报出的,google搜索windows,对应原因描述:
ERROR_DIRECTORY
267 The directory name is invalid.
 
其他出现的错误码参见完整的错误码列表:
Windows MSDN上:System Error Codes
Windows API Guide Error Codes.txt.html
 
 
原创粉丝点击