edvin / fxlauncher

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

Problem with createApplication method #111

Open fjtorres opened 6 years ago

fjtorres commented 6 years ago

I am trying to use FXLauncher with custom process to build setup and executable files using Launch4j and Inno-Setup because javapackager doesn't allow to configure specific process to delete files when uninstall the application.

However when I try to launch my custom project from Eclipse the createApplication method from AbstractLauncher cannot create the new instance of the application because appClass.isAssignableFrom(Application.class) return false. My custom application class is a subclass of JavaFX application class so for me is strange this condition. Should be the opposite?

I think that this condition should be this Application.class.isAssignableFrom(appClass) because appClass should be a subclass of JavaFX Application.

Besides if the current code cannot create the application instance the launcher are trying to run the first dependency that found in the classpath, in my case activation.jar.

Related code https://github.com/edvin/fxlauncher/blob/03bea5efc6b9d4123fe91837ffe109c2dc12a043/src/main/java/fxlauncher/Launcher.java#L50

FXLauncher version: 1.0.19

fjtorres commented 6 years ago

@edvin What do you think about this?

edvin commented 6 years ago

Thanks, I've committed a fix and will release a new version shortly :)