edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
714 stars 110 forks source link

java.lang.NoClassDefFoundError on First Launch After JAR Update #204

Open lzpzywoo opened 2 months ago

lzpzywoo commented 2 months ago

I encountered an issue after updating the JAR file in my project. Upon the first launch after the update, I receive the following error:

Caused by: java.lang.ClassNotFoundException: com.doorun.uploadreport.HospitalNetworkInfoApp 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) ... 13 more

However, if I close the application and restart it, the issue does not occur, and the update works successfully. Additionally, when running the application in IntelliJ IDEA, I do not experience this problem during the update process.

However, if I close the application and restart it, the issue does not occur, and the update works successfully. Additionally, when running the application in IntelliJ IDEA, I do not experience this problem during the update process.

Steps to Reproduce:

Update the JAR file in the project. Launch the application for the first time. Observe the NoClassDefFoundError. Close the application and restart it. Note that the application launches successfully without errors. Expected Behavior: The application should launch without errors after the JAR file update.

Environment:

JRE version: 17 IDE: IntelliJ IDEA [2023.2.3] Operating System: Windows 10 (version 19045) Thank you for your assistance!