Skip to content

Instantly share code, notes, and snippets.

@romixch
Created October 27, 2019 20:52
Show Gist options
  • Save romixch/8f5dbcbb473d499c67eae1fbf34007bb to your computer and use it in GitHub Desktop.
Save romixch/8f5dbcbb473d499c67eae1fbf34007bb to your computer and use it in GitHub Desktop.
Fix start script for windows generated by gradle application plugin
tasks.withType<CreateStartScripts>(CreateStartScripts::class.java) {
doLast {
var text = windowsScript.readText()
text = text.replaceFirst(Regex("(set CLASSPATH=%APP_HOME%\\\\lib\\\\).*"), "set CLASSPATH=%APP_HOME%\\\\lib\\\\*")
windowsScript.writeText(text)
}
}
@romixch
Copy link
Author

romixch commented Oct 27, 2019

When you use the application plugin for gradle to generate a distZip, you likely run into errors on Windows. Starting the generated start batch script, shows up the input line is too long. This fixes it by using a wildcard in the CLASSPATH to get all jar files in the lib folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment