Error: Could not find or load main class
已回答
Hello
I try to build a JavaFX application but when i build it and launch it i have
Error: Could not find or load main class fr.bagou.mc.launcher.serverfirst.LauncherMain
So i tried to change files sources, change Application class of the artifact, create a new artifact but that don't work.
If i open the .jar with 7zip i see that there are all class nothing is missing.
In the MANIFEST.MF i have:
Main-Class: fr.bagou.mc.launcher.serverfirst.LauncherMain
so no problem here
I don t understand the problem here



Can you help me?
请先登录再写评论。
Hi
Upload id: 2022_10_21_mzSHFuWQKkJH5JZGUZyMLZ (file: ez.zip)
The jar is built incorrectly. You need to extract all the dependent jars inside the main jar. See https://stackoverflow.com/a/42200519/104891 for the sample project.
Also, with JavaFX, there is no easy way to create a self contained runnable jar that will work on all the platforms because it also needs to have native dependencies for JavaFX runtime. It will not work via the simple artifact configuration in the IDE.
Please consider using Gradle and https://github.com/dlemmermann/JPackageScriptFX.
Okey i tried many thing and at final i see that there are a error in lib i resolved it and now work