应用程序在编辑器中运行,但不在.exe

时间:2018-05-28 13:07:16

标签: java javafx stream exe packaging

我刚刚完成了一个小项目,该项目应该读取exel文件并在表视图中显示,并且很高兴当我在Intellij中启动应用程序时一切正常。然后,当我使用.exe文件构建我的JavaFX应用程序工件时,应用程序启动但在某处发生了之前未发生的错误。

来自Windows cmd的错误消息:

    C:\Users\E0297813\IdeaProjects\Sachbearbeiter\out\artifacts\Sachbearbeiter\bundl
    es\Sachbearbeiter\app>C:\Users\E0297813\IdeaProjects\Sachbearbeiter\out\artifact
    s\Sachbearbeiter\bundles\Sachbearbeiter\runtime\bin\java.exe -jar C:\Users\E0297
    813\IdeaProjects\Sachbearbeiter\out\artifacts\Sachbearbeiter\bundles\Sachbearbei
    ter\app\Sachbearbeiter.jar
    C:\Users\E0297813\Desktop\aaaaaaaaaaa.xlsx
    Exception in Application start method
    java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:497)
            at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Lau
    ncherImpl.java:389)
            at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImp
    l.java:328)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:497)
            at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
    Caused by: java.lang.RuntimeException: Exception in Application start method
            at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherIm
    pl.java:917)
            at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(
    LauncherImpl.java:182)
            at com.sun.javafx.application.LauncherImpl$$Lambda$50/31748187.run(Unkno
    wn Source)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.NoClassDefFoundError: com/monitorjbl/xlsx/StreamingReader
            at sample.Main.search_id(Main.java:483)
            at sample.Main.createcomponents(Main.java:245)
            at sample.Main.start(Main.java:124)
            at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159
    (LauncherImpl.java:863)
            at com.sun.javafx.application.LauncherImpl$$Lambda$94/7771974.run(Unknow
    n Source)
            at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(Platfor
    mImpl.java:326)
            at com.sun.javafx.application.PlatformImpl$$Lambda$46/20085625.run(Unkno
    wn Source)
            at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.
    java:295)
            at com.sun.javafx.application.PlatformImpl$$Lambda$48/32120612.run(Unkno
    wn Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformI
    mpl.java:294)
            at com.sun.javafx.application.PlatformImpl$$Lambda$47/2900468.run(Unknow
    n Source)
            at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatch
    er.java:95)
            at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
            at com.sun.glass.ui.win.WinApplication.lambda$null$145(WinApplication.ja
    va:101)
            at com.sun.glass.ui.win.WinApplication$$Lambda$36/17230114.run(Unknown S
    ource)
            ... 1 more
    Caused by: java.lang.ClassNotFoundException: com.monitorjbl.xlsx.StreamingReader

        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 17 more
Exception running application sample.Main

C:\Users\E0297813\IdeaProjects\Sachbearbeiter\out\artifacts\Sachbearbeiter\bundl
es\Sachbearbeiter\app>pause
Drücken Sie eine beliebige Taste . . .

当我尝试在IntelliJ中运行它时,为什么没有显示出来? 它与我的JDK和JRE版本有什么关系可能不对吗?

我不知道问题可能是什么。

如果您需要任何进一步的信息,请告诉我您的需求。

感谢您的帮助

0 个答案:

没有答案