windows下eclipse編譯報錯:CreateProcess error=206

http://isuifengfei.iteye.com/blog/1684262 

http://www.tuicool.com/articles/nauYf2

windows下,eclipse中運行junit出現錯誤提示: 
Exception occurred executing command line. 
Cannot run program "D:\Program Files\Java\jdk1.6.0_30\bin\javaw.exe" (in directory "D:\work\mywork\20120829_159367_2\biz\product"): CreateProcess error=206, ÎļþÃû»ò)չÃû 

原因是在Windows下命令行支持的字符串長度是有限制的, 
在計算機上運行 Microsoft Windows XP 或更高版本,可以在命令提示符下使用的字符串的最大的長度 8191 個字符。  
在運行 Microsoft Windows 2000 或 Windows NT 4.0 的計算機上, 將最大長度可以在命令提示符下使用的字符串的爲 2047 個字符。 
(參照微軟官方文檔:http://support.microsoft.com/kb/830473/zh-cn) 

這個是eclipse的bug,參考:https://bugs.eclipse.org/bugs/show_bug.cgi?id=327193 
解決辦法: 
(1)下載修復包:https://bugs.eclipse.org/bugs/attachment.cgi?id=219900 
(2)把本地eclipse的eclipse/plugins/org.eclipse.jdt.launching_3.4.*.jar複製到一個安全的地方,便於恢復。 
- copy your eclipse/plugins/org.eclipse.jdt.launching_3.4.*.jar to a safe place outside of the plugins folder, so that you always have a way to revert 
- close Eclipse 
(3)把jar重命名爲zip 
- rename the *.jar to *.zip 
(4)打開zip包,拷貝下載的修復包裏面的四個class文件到org\eclipse\jdt\internal\launching裏面 
- open the zip file and copy the 4 class files from the attachment to org\eclipse\jdt\internal\launching (replace existing files) 
(5)進入META-INF目錄,刪除除了MANIFEST.MF以外的所有的文件 
- go to META-INF in the zip file and delete all files except MANIFEST.MF 
(6)解壓MANIFEST.MF,刪除以 "NAME:"開頭的所有的entry(兩行是一個entry) 
- extract MANIFEST.MF to your disk and edit it with a text editor 
- remove everything starting from the first "NAME:" entry 
(7)保證MANIFEST.MF文件的結尾有兩個空行 
- make sure you leave *two* (2) line break characters at the end of the file! 
(8)保存MANIFEST.MF進zip包 
- save the MANIFEST.MF and copy it back into the zip file 
(9)zip包重命名爲jar 
- rename the *.zip back to *.jar 
(10)放到eclipse下面,替換之前的jar 

- enjoy

高版本的eclipse(4.3 M1)已經修復這個bug了。 

修改以後的jar包下載:http://download.csdn.net/download/goldenfish1919/6244901


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章