1

次の詳細で JavaFX プロジェクトを作成しました。

OpenJFX 15-ea+3/ JDK 14/ Gradle/Non-modular

また、次の Gradle プラグインを使用しています。

javafxplugin version 0.0.8/ org.beryx.runtime version 1.8.2& com.github.johnrengelman.shadow version 5.2.0(ネイティブ イメージの作成用)

さらに、JDK 14jpackageツールを使用して、アプリケーションのインストーラー パッケージを作成します。build.gradleファイルは次のとおりです。

plugins {
    id 'java'
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.8'
    id 'org.beryx.runtime' version '1.8.2'
    id "com.github.johnrengelman.shadow" version "5.2.0"
}

group 'com.pastor'
version '1.0-SNAPSHOT'

sourceCompatibility = 14
targetCompatibility = 14
//This option is for rendering persian characters encoding
compileJava.options.encoding = 'UTF-8'

javafx {
    version = "15-ea+3"
    modules = [ 'javafx.controls', 'javafx.fxml']
}

repositories {
    mavenCentral()
}

dependencies {
    runtimeOnly "org.openjfx:javafx-controls:$javafx.version:win"
    runtimeOnly "org.openjfx:javafx-fxml:$javafx.version:win"
    runtimeOnly "org.openjfx:javafx-media:$javafx.version:win"
    compile group: 'com.jfoenix', name: 'jfoenix', version: '9.0.9'
    compile 'de.jensd:fontawesomefx-fontawesome:4.7.0-9.1.2'
    compile 'de.jensd:fontawesomefx-icons525:4.2.0-9.1.2'
    compile 'de.jensd:fontawesomefx-materialdesignfont:2.0.26-9.1.2'
    compile 'de.jensd:fontawesomefx-materialicons:2.2.0-9.1.2'
    compile group: 'org.controlsfx', name: 'controlsfx', version: '11.0.1'
}

runtime {
    options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
    jpackage {
        if(org.gradle.internal.os.OperatingSystem.current().windows) {
            appVersion = '1.0.0'
            skipInstaller = false
            installerName = 'Pastor apartment unit management system'
            installerType = 'exe'
            installerOptions = ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut']
        }
    }
}
mainClassName = 'sample.Launcher'

私はすでにブロックimageOptions = ['--icon icon.ico']内で試しましたが、常にこの種のエラーが発生します:jpackage

Error: Invalid Option: [--icon app.ico]

有用な提案やヒントは大歓迎です。

4

1 に答える 1