gpt4 book ai didi

java - Intellij IDEA 代码覆盖率不起作用

转载 作者:搜寻专家 更新时间:2023-11-01 03:23:49 25 4
gpt4 key购买 nike

当我尝试使用覆盖率运行我的 JUnit 测试时,我收到以下错误

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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:397)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.coverage.main.CoveragePremain.premain(CoveragePremain.java:50)
... 6 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at com.intellij.rt.coverage.instrumentation.Instrumentator.premain(Instrumentator.java:40)
... 11 more
Exception in thread "main"
Process finished with exit code 1

谁能帮忙修一下?

最佳答案

看这里: https://youtrack.jetbrains.com/issue/IDEABKL-5941

你可以在idea的启动脚本中添加-Djava.io.tmpdir参数或者替换TMP系统属性。

此外,您可能还必须更改安装目录中 idea.properties 中的 idea.config.path 和 idea.system.path。

关于java - Intellij IDEA 代码覆盖率不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20907103/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com