Skip to content

Instantly share code, notes, and snippets.

@Faz95210
Last active May 29, 2018 02:58
Show Gist options
  • Save Faz95210/a8f6b4e3449aa8d111ec1ae15574c195 to your computer and use it in GitHub Desktop.
Save Faz95210/a8f6b4e3449aa8d111ec1ae15574c195 to your computer and use it in GitHub Desktop.
[Create .exe with Java, Launch4J and Gradle] How to generate a .exe in java with gradle and launch4J #Java #Gradle #Launch4J #executable #windows
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath group: 'edu.sc.seis.gradle', name: 'launch4j', version: '2.4.3' // dependency for the launch4J plugin
}
}
apply plugin: 'edu.sc.seis.launch4j' //add the plugin
launch4j {
mainClassName = 'com.package.your.app.MainClass' // path to the main class
icon = "${projectDir}/src/main/resources/icon/icon.ico" //.exe's Icon
outfile = 'extracter.exe' // File Name
jvmOptions.add("-Xmx1g")
jvmOptions.add("-Xms1g")
jreMaxVersion = '1.8.9'
jdkPreference = 'preferJre'
stayAlive = true
bundledJre64Bit = true
bundledJrePath = 'jre'
jar="${projectDir}/build/libs/ecataxtractexec-1.0-SNAPSHOT.jar"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment