代码之家  ›  专栏  ›  技术社区  ›  keplerian

为什么用Install4j 6构建的macOS安装程序在JRE 10中抛出运行时异常?

  •  1
  • keplerian  · 技术社区  · 6 年前

    我在运行用Install4j 6.1.6构建的macOS安装程序时遇到以下运行时异常,该安装程序使用JRE 10.0.2+13运行:

    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:105)
        at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:58)
        at com.install4j.runtime.installer.Installer.main(Installer.java:46)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
        at com.install4j.runtime.launcher.MacLauncher.main(MacLauncher.java:67)
    Caused by: java.lang.reflect.InvocationTargetException
        at java.desktop/java.awt.EventQueue.invokeAndWait(Unknown Source)
        at java.desktop/java.awt.EventQueue.invokeAndWait(Unknown Source)
        at java.desktop/javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
        at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:96)
        ... 8 more
    Caused by: java.lang.NoClassDefFoundError: com/apple/eawt/ApplicationListener
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Unknown Source)
        at com.install4j.runtime.installer.frontend.WizardScreenExecutor.<init>(WizardScreenExecutor.java:49)
        at com.install4j.runtime.installer.frontend.InstallerWizardScreenExecutor.<init>(InstallerWizardScreenExecutor.java:18)
        at com.install4j.runtime.installer.Installer$2.run(Installer.java:99)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.desktop/java.awt.EventQueue.access$600(Unknown Source)
        at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
        at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: com.apple.eawt.ApplicationListener
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 19 more
    

    1 回复  |  直到 6 年前
        1
  •  1
  •   Ingo Kegel    6 年前

    install4j6不能与java9+一起使用,您必须至少使用install4j7。