在 cmd 或 Powershell 中,我执行 java -jar file.jar (javaw 不返回任何内容,但也不运行程序)。
它使用swing,当我运行它时:
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: javax.swing.JDialog.setAutoRequestFocus(Z)V
at file.fileView.initComponents(fileView.java:852)
at file.fileView.<init>(fileView.java:42)
at file.fileApp.startup(fileApp.java:50)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
它说他们没有这样的.requestFocus方法。
这是使用 Netbeans 自动生成的,它在 Netbeans 中运行良好。但是,它不在 cmd/powershell 中。
谢谢,
贾斯汀·W。