testng测试报错:java.lang.UnsatisfiedLinkError: no attach in java.library.path解决方案

1、报错信息

java.lang.IllegalStateException: Native library for Attach API not available in this JRE
Caused by: java.lang.UnsatisfiedLinkError: no attach in java.library.path
[TestNG] Running:
  C:\Users\liangzhicheng\AppData\Local\Temp\testng-eclipse--1609936300\testng-customsuite.xml

FAILED: testAdd
java.lang.IllegalStateException: Native library for Attach API not available in this JRE
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.tools.attach.WindowsVirtualMachine

FAILED: testCountSSubjectBlockItem
java.lang.IllegalStateException: Native library for Attach API not available in this JRE
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.tools.attach.WindowsVirtualMachine

FAILED: testDelete
java.lang.IllegalStateException: Native library for Attach API not available in this JRE
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.tools.attach.WindowsVirtualMachine

FAILED: testGet
java.lang.IllegalStateException: Native library for Attach API not available in this JRE
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.tools.attach.WindowsVirtualMachine

FAILED: testGetList
java.lang.IllegalStateException: Native library for Attach API not available in this JRE
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.tools.attach.WindowsVirtualMachine

FAILED: testUpdate
java.lang.IllegalStateException: Native library for Attach API not available in this JRE
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.tools.attach.WindowsVirtualMachine


===============================================
    Default test
    Tests run: 6, Failures: 6, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 6, Failures: 6, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.XMLReporter@5700d6b1: 12 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@598067a5: 25 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 6 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@72d818d1: 10 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@1e397ed7: 9 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@553f17c: 41 ms

2、报错原因::java.lang.UnsatisfiedLinkError: no attach in java.library.path

3、解决方案:右键单击>Run As > Run Configurations 选择存在的的JRE包,点击Run即可;若没有JRE包可选,点击Install JREs添加,点击Ok ,再点击Run即可。
这里写图片描述
这里写图片描述

关注我的技术公众号《漫谈人工智能》,每天推送优质文章

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

两只橙

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值