因为jdk版本不兼容,因为安装了最新的jdk,要换版本的jdk
在使用Jmeter时,点击保存按钮提示错误,如下所示:
2021-05-07 14:42:15,861 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]
java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.gui.util.FileDialoger
at org.apache.jmeter.gui.action.Save.computeFileName(Save.java:201) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.gui.action.Save.doAction(Save.java:163) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:87) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.gui.action.ActionRouter.lambdaactionPerformedactionPerformed0(ActionRouter.java:69) ~[ApacheJMeter_core.jar:5.4.1]
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316) ~[?:?]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) ~[?:?]
at java.awt.EventQueue4.run(EventQueue.java:721) [?:?]atjava.awt.EventQueue4.run(EventQueue.java:721) [?:?]atjava.awt.EventQueue4.run(EventQueue.java:715) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:391) ~[?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) ~[?:?]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:740) ~[?:?]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?]
解决方法:
这是因为您装了最新版的JDK,报这个错误时我装得JDK版本是16.0.1
JMeter的版本是5.4.1
此时说明JDK的版本太高,导致JMeter还不兼容,所以我们只需要换一个JDK版本就可以了,我换了JDK的版本是11.0.11,
完美解决此问题。