i tried to convert my JavaFX Projekt from IntelliJ to a Exe using Launch4j.
But now i am stuck with this error.. none of the other solutions on stackoverflow worked. Can anyone help me with my problem?
Exception in Application constructor
Exception in thread "main" java. lang RuntimeException: Unable to construct Application instance: class Launcher$Main at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java: 883) at [email protected]/com.sun.javax.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl. java:196)
at java.base/java. lang.Thread. run(Thread. java:1583)
Caused by: java. lang.NoClassDefFoundError: at org/apache/poi/ss/usermodel/Workbook
java.base/java. lang.Class.getDeclaredConstructors0(Native Method) at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3549)
at java.base/java.lang.Class.getConstructor0(Class.java: 3754)
at java.base/java.lang.Class.getConstructor(Class. java:2442)
at [email protected]/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java: 794)
at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
at
[email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java: 456)
java.base/java.security.AccessController.doPrivileged(AccessController. java:400)
at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
[email protected]/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
[email protected]/com.sun.glass.ui.win.WinApplication.
_runLoop(Native Method)
at [email protected]/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
...1 more
Caused by:
java. lang.ClassNotFoundException: org.apache.poi.ss.usermodel.Workbook at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
java.base/java.lang.ClassLoader.loadClass(ClassLoader. java:526)
... 13 more
error
public class Launcher {
public static void main(String[] args) {
Application.launch(Main.class, args);
}
public static class Main extends Application {
public Main(){}
@Override
public void start(Stage primaryStage) throws Exception {
}
}
}
I removed the code inside the methods. This error even happens without any code inside.
In already tried to put the Main class in the launcher class. But this didnt solved my problem.
And I configured the classpath in launch4j.
launch4j Classpath
I need the POI Jar Files to read and write Excel Files. This is necessary for my project.
Applicator is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.