IDEA 查看Springboot单元测试代码覆盖率报错

img

img

报错信息:
D:\resource\java_jdk_1.8.261\bin\java.exe -ea -javaagent:C:\Users\镜\AppData\Local\JetBrains\IntelliJIdea2020.2\testAgent\intellij-coverage-agent-1.0.512.jar=C:\Users\镜\AppData\Local\Temp\coverage10args -Didea.test.cyclic.buffer.size=1048576 "-javaagent:E:\tools\IntelliJ IDEA 2020.2\lib\idea_rt.jar=60647:E:\tools\IntelliJ IDEA 2020.2\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\镜\AppData\Local\Temp\classpath770525232.jar com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.faw_qm.erpcg.gld.gld895.service.TestGld895Service
FATAL ERROR in native method: processing of -javaagent failed
Exception in thread "main" 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:498)
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:498)
at com.intellij.rt.coverage.main.CoveragePremain.premain(CoveragePremain.java:35)
at com.intellij.rt.coverage.main.CoveragePremain.premain(CoveragePremain.java:28)
6 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at com.intellij.rt.coverage.instrumentation.Instrumentator.performPremain(Instrumentator.java:55)
at com.intellij.rt.coverage.instrumentation.Instrumentator.premain(Instrumentator.java:33)
12 more

Process finished with exit code 1

解决方案: 1.更改window 登录的用户名为英文。(此方法自行百度吧,就不做讲解了)

2.更改idea生成文件的默认路径:

  help->Edit Custom VM Options...  中添加  -Djava.io.tmpdir=E:\resource\idea\Temp

注意: 一定要先创建对应的文件夹 

 

 

既然都更改了临时文件的位置,不如其他的默认路径一起更改了吧:

注意:更改下面的默认路径配置之后,之前的idea插件将全部丢失!!!

1.找到idea安装目录下面的bin文件下的idea.properties

(E:\tools\IntelliJ IDEA 2020.2\bin\idea.properties)

找到:idea.system.path=${user.home}/.IntelliJIdea/system

idea.plugins.path=${idea.config.path}/plugins

更改即可。

 

 

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值