自IntelliJ中的更新14.1.1以来无法运行代码覆盖率

时间:2015-04-14 20:39:42

标签: java intellij-idea code-coverage

由于我将 IntelliJ 更新为 14.1.1 ,因此无法运行代码覆盖率。

我可以毫无问题地运行Test,但Code Coverage按钮总是给我这个错误:

FATAL ERROR in native method: processing of -javaagent failed
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.coverage.main.CoveragePremain.premain(CoveragePremain.java:66)
    ... 6 more
Caused by: java.io.IOException: Le chemin d’accès spécifié est introuvable
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1012)
    at com.intellij.rt.coverage.data.ProjectData.createProjectData(ProjectData.java:92)
    at com.intellij.rt.coverage.instrumentation.Instrumentator.premain(Instrumentator.java:75)
    ... 11 more
Exception in thread "main" 
Process finished with exit code 1

我一开始认为我在更新时做错了,我重新安装了它,但它仍然没有用。

1 个答案:

答案 0 :(得分:0)

https://youtrack.jetbrains.com/issue/IDEABKL-5941#comment=27-421957 这可以帮助

  

解决方法:   添加此行

     

-Djava.io.tmpdir = C:\温度

     

到idea.exe.vmoptions文件(在C:\ Program Files \ ideaIU-11.1.4 \ bin中)   并确保C:\ Temp存在。