then the application is failed to launch with error
pure virtual method called
terminate called without an active exception
Error: Can not detect and load a main class "extension 'application' property 'mainClass'"
Cause: java.lang.ClassNotFoundException: extension 'application' property 'mainClass'
investigation
Because Gradle 8.x deprecated an application convention, and mainClassName = 'java.class.name' String syntax is replaced to
application.mainClass = 'java.main.class' by application plugin and it can be referenced by application.mainClass.
JavaApplication#getMainClass returns Property<String>, but jpackage plugin does not accept Property object.
similar case that works well in Gradle
You may know that JavaExec task can take a property in similar syntax such as
Problem
Configure jpackage task using
application.mainClass
property likethen the application is failed to launch with error
investigation
Because Gradle 8.x deprecated an application convention, and
mainClassName = 'java.class.name'
String syntax is replaced toapplication.mainClass = 'java.main.class'
by application plugin and it can be referenced byapplication.mainClass
.JavaApplication#getMainClass
returnsProperty<String>
, but jpackage plugin does not accept Property object.similar case that works well in Gradle
You may know that
JavaExec
task can take a property in similar syntax such asJavaExec
class in Gradle project source defines parameters likethen it can accept the syntax.
Here is a proposal to change internal variables from
String
toProvider<String>
, and change references toobject.get()
.User side solution
User can avoid a problem when using
jpackage
rather than a way
JavaExec
accepts.