Jini is a simple executable for Windows that launches a JVM and starts your java app.
# compile jni invocation library and app
make JNI="c:/soft/java-17/include"- Compile
- Rename jini.exe to preferred name
- Copy exe to target location
- In target location create folder
liband put classpath jars into it - In folder
libcreate filepackage.jsonwhich describe your distro - Launch exe
{
"main.class": "com.example.Application",
"class.path": [
"lib/example-1.0.jar",
"lib/gson-2.13.0.jar",
"lib/logback-classic-1.5.18.jar",
"lib/logback-core-1.5.18.jar",
"lib/slf4j-api-2.0.17.jar",
],
"vm.args": [
"-Xmx64m",
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseZGC"
],
"args": [
"-debug"
]
}Resources of exe file can be created with rcedit
rcedit "cmake-build-release/jini.exe" \
--set-file-version "1.0.0.1" \
--set-product-version "1.0.0.1" \
--set-version-string "Comments" "App Comment" \
--set-version-string "FileDescription" "File Description" \
--set-version-string "ProductName" "Product Name" \
--set-version-string "LegalCopyright" "Legal Copyright" \
--set-icon "icon.ico"- add plugin to build.gradle
plugins {
id 'com.sb.jini' version '0.4'
}
repositories {
maven {
url = "https://maven.sergeybochkov.com/releases"
}
}- configure plugin
tasks.named('jini').configure {
mainClassName = 'com.example.Application'
exeFilename = 'application.exe'
vmArgs = ['-Xmx64m']
icon = "${projectDir}/src/main/resources/style/application.ico"
fileVersion = "1.0.0.0"
productVersion = "1.0.0.0"
comments = "My Application"
fileDescription = "My Application"
productName = "My Application"
copyright = "Company"
}- run jini task