TheBoegl / gradle-launch4j

A gradle-plugin to create windows executables with launch4j
Apache License 2.0
298 stars 40 forks source link

No such field error after upgrading 2.5.4 -> 3.0.4 #163

Closed marksilcox closed 9 months ago

marksilcox commented 9 months ago

I have been trying to upgrade to the latest version of the plugin (3.0.4). Checking the docs I have changed the config from:


launch4j {
    headerType = "console"
    mainClassName = "org.springframework.boot.loader.JarLauncher"
    bundledJrePath = "Java\\jdk-17"
    outfile = "${project.name}-${project.version}.exe"
    jarTask = project.tasks.bootJar
    jvmOptions = ["-Dfile.encoding=UTF-8", "-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"]
    jdkPreference = "preferJdk"
    jreRuntimeBits = "64"
    bundledJre64Bit = true
    productName = "My Product"
    messagesStartupError = "Failed to start"
    messagesBundledJreError = "Error encountered with bundled JRE"
    messagesJreVersionError = "JRE Found, but expected different version"
    messagesInstanceAlreadyExists = "App is already running"
}

to:

launch4j {
    headerType = "console"
    mainClassName = "org.springframework.boot.loader.JarLauncher"
    bundledJrePath = "Java\\jdk-17"
    outfile = "${project.name}-${project.version}.exe"
    jarTask = project.tasks.bootJar
    jvmOptions = ["-Dfile.encoding=UTF-8", "-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"]
    requiresJdk = true
    requires64Bit = true
    productName = "My Product"
    messagesStartupError = "Failed to start"
    messagesJreNotFoundError = "Error encountered with bundled JRE"
    messagesJreVersionError = "JRE Found, but expected different version"
    messagesInstanceAlreadyExists = "App is already running"
}

But when running createExe I get the following error:

No such field net.sf.launch4j.config.Msg.bundledJreErr
---- Debugging information ----
message             : No such field net.sf.launch4j.config.Msg.bundledJreErr
field               : bundledJreErr
class               : net.sf.launch4j.config.Msg
required-type       : net.sf.launch4j.config.Msg
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /launch4jConfig/messages/bundledJreErr
class[1]            : net.sf.launch4j.config.Config
required-type[1]    : net.sf.launch4j.config.Config
version             : 1.4.20
-------------------------------

If I remove messagesJreNotFoundError it is successful.

TheBoegl commented 9 months ago

Thanks for catching this. I fixed it and released version 3.0.5.