Mac无法打开.jar文件

时间:2017-12-06 13:05:33

标签: java jar

我正在尝试下载一些用java编写并扩展名为.jar的程序。

我遇到两种类型的失败:

  1. Java程序启动(我可以看到它从应用程序启动)但没有显示。

  2. 无法启动Java Jar文件“...”。检查控制台是否有可能的错误消息

  3. 这是我在控制台中收到的消息:

    我看不到显示的错误,但你认为它在说什么?

    新错误:

    Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1328)
        at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1303)
        at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1475)
        at com.epicbot.iIIiiIiiIIiIi.main(ihc:263)
        at com.epicbot.Boot.main(imc:404)
    Caused by: java.lang.NoClassDefFoundError: com/apple/eawt/QuitHandler
        at com.epicbot.IIIiIIiiiIIIi.ALLATORIxDEMO(dzb:459)
        at com.epicbot.iiIIIIiiiIIiI.run(ihc:315)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
        at java.desktop/java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:717)
        at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:711)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:89)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:199)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    Caused by: java.lang.ClassNotFoundException: com.apple.eawt.QuitHandler
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
    

1 个答案:

答案 0 :(得分:0)

这意味着,您当前的java不支持jar中使用的方法。

删除了这些方法:

https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-97C1D0BB-D5D3-4CAD-B17D-03A87A0AAF3B

也许您可以尝试安装较旧的JRE并重试

在此处查看有关安装JRE的更多信息:https://www.java.com/en/download/faq/java_mac.xml