嗨,当我在类路径中用jmockit-1.9.jar启动服务器时,我收到了下面的错误。知道怎么解决这个问题吗?
14:35:58,932 ERROR [stderr] (http-/0.0.0.0:12000-4) java.lang.RuntimeException: com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute 14:35:58,933 ERROR [stderr] (http-/0.0.0.0:12000-4) at mockit.internal.startup.AgentLoader.loadAgentAndDetachFromThisVM(AgentLoader.java:115
发布于 2019-08-28 17:58:18
在文档中说:
确保指定的版本(此处在"jmockit.version“属性中指定)是您实际需要的版本。在“开发历史记录”页面中找到当前版本。JMockit还需要使用Maven JVM初始化参数;当使用Maven Surefire插件执行测试时,它被指定如下:
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version> <!-- or some other version -->
<configuration>
<argLine>
-javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
</argLine>
</configuration>
</plugin>
</plugins>https://stackoverflow.com/questions/27389503
复制相似问题