TheBoegl / gradle-launch4j

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

Invalid data: Minimum JRE version should be x.x.x[_xx] #116

Closed mbachinger closed 1 year ago

mbachinger commented 3 years ago

I am attempting to use this plugin with my Java application using Java 11. I keep getting the error: net.sf.launch4j.BuilderException: Invalid data: Minimum JRE version should be x.x.x[_xx] Does this plugin not work with Java 11?

TheBoegl commented 3 years ago

@mbachinger take a look at the documentation mentioning

<minVersion>, <maxVersion> format - Java >= 9 The new version format is xxx[.xxx[.xxx]] where only 1 part is required and the update version after the underscore is not allowed.

  • 1.6
  • 9
  • 10.0.1
mbachinger commented 3 years ago

@TheBoegl Thanks for the reply. I am not specifying the underscore or the portion after though. I have tried:

I also tried setting the targetCompatibility since this overrides it.

Versions 9 and under work but 10 and 11 don't.

This is the createExe.xml being created before running into that error:

<?xml version='1.0' encoding='UTF-8'?>
<launch4jConfig>
  <dontWrapJar>false</dontWrapJar>
  <headerType>gui</headerType>
  <jar>lib/wdirclient-4.4.jar</jar>
  <outfile>wdirclient.exe</outfile>
  <errTitle></errTitle>
  <cmdLine></cmdLine>
  <chdir>.</chdir>
  <priority>normal</priority>
  <downloadUrl>http://java.com/download</downloadUrl>
  <supportUrl></supportUrl>
  <stayAlive>false</stayAlive>
  <restartOnCrash>false</restartOnCrash>
  <manifest></manifest>
  <icon>..\..\src\dist\favicon.ico</icon>
  <classPath>
    <mainClass>wdirclient.WesternDirectoryClient</mainClass>
    <cp>lib\wdirclient-4.4.jar</cp>
  </classPath>
  <jre>
    <path></path>
    <bundledJre64Bit>false</bundledJre64Bit>
    <bundledJreAsFallback>false</bundledJreAsFallback>
    <minVersion>11.0.0</minVersion>
    <maxVersion></maxVersion>
    <jdkPreference>preferJre</jdkPreference>
    <runtimeBits>64/32</runtimeBits>
  </jre>
  <versionInfo>
    <fileVersion>4.4.0.0</fileVersion>
    <txtFileVersion>4.4</txtFileVersion>
    <fileDescription>wdirclient</fileDescription>
    <copyright>unknown</copyright>
    <productVersion>4.4.0.0</productVersion>
    <txtProductVersion>4.4</txtProductVersion>
    <productName>wdirclient</productName>
    <companyName></companyName>
    <internalName>wdirclient</internalName>
    <originalFilename>wdirclient.exe</originalFilename>
    <trademarks></trademarks>
    <language>ENGLISH_US</language>
  </versionInfo>
</launch4jConfig>
<launch4jConfig>
  <dontWrapJar>false</dontWrapJar>
  <headerType>gui</headerType>
  <jar>lib/wdirclient-4.4.jar</jar>
  <outfile>wdirclient.exe</outfile>
  <errTitle></errTitle>
  <cmdLine></cmdLine>
  <chdir>.</chdir>
  <priority>normal</priority>
  <downloadUrl>http://java.com/download</downloadUrl>
  <supportUrl></supportUrl>
  <stayAlive>false</stayAlive>
  <restartOnCrash>false</restartOnCrash>
  <manifest></manifest>
  <icon>..\..\src\dist\favicon.ico</icon>
  <classPath>
    <mainClass>wdirclient.WesternDirectoryClient</mainClass>
    <cp>lib\wdirclient-4.4.jar</cp>
  </classPath>
  <jre>
    <path></path>
    <bundledJre64Bit>false</bundledJre64Bit>
    <bundledJreAsFallback>false</bundledJreAsFallback>
    <minVersion>11.0.0</minVersion>
    <maxVersion></maxVersion>
    <jdkPreference>preferJre</jdkPreference>
    <runtimeBits>64/32</runtimeBits>
  </jre>
  <versionInfo>
    <fileVersion>4.4.0.0</fileVersion>
    <txtFileVersion>4.4</txtFileVersion>
    <fileDescription>wdirclient</fileDescription>
    <copyright>unknown</copyright>
    <productVersion>4.4.0.0</productVersion>
    <txtProductVersion>4.4</txtProductVersion>
    <productName>wdirclient</productName>
    <companyName></companyName>
    <internalName>wdirclient</internalName>
    <originalFilename>wdirclient.exe</originalFilename>
    <trademarks></trademarks>
    <language>ENGLISH_US</language>
  </versionInfo>
</launch4jConfig>
TheBoegl commented 3 years ago

@mbachinger I've edited your answer to display your xml output as code block. I'm unable to reproduce your error. Please provide a minimal reproducible example. Creating the executable with your provided xml works for me.

mbachinger commented 2 years ago

@TheBoegl Changing the Launch4j version to 2.4.4 fixed the problem.

TheBoegl commented 2 years ago

@mbachinger Are you referring to this plugin in version 2.4.4 from 2018? To really help you please attach a failing project configuration or a link to a repository. I'm still unable to reproduce this issue.