Anatoly
Anatoly

Reputation: 1591

Intellij IDEA code coverage doesn't work

When I'm trying to run my JUnit tests with coverage I receive the following error

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

Can anybody help to fix it?

Upvotes: 4

Views: 5236

Answers (1)

astafev.evgeny
astafev.evgeny

Reputation: 476

Take a look here: https://youtrack.jetbrains.com/issue/IDEABKL-5941

You can add -Djava.io.tmpdir param to idea's launching script or replace TMP system property.

Also probably you will have to change idea.config.path and idea.system.path in idea.properties in installation directory.

Upvotes: 2

Related Questions