gluonhq / gluonfx-gradle-plugin

Plugin that simplifies using Gluon Client for Java/JavaFX gradle projects
BSD 3-Clause "New" or "Revised" License
100 stars 21 forks source link

native-image-agent #161

Open rizeo opened 2 years ago

rizeo commented 2 years ago

Hello, I have such a problem, please help me run this command gradlew nativeRunAgent

os: windows 10 x64 graalvm version:graalvm-ce-java11-22.1.0 jdk path:C:\graalvm-ce-java11-22.1.0\bin\java.exe

page error log error.txt

Error occurred during initialization of VM agent library failed to init: native-image-agent native-image-agent: Error: Output directory 'src\main\resources\META-INF\native-image' is locked by process 19228, which means another agent instance is already writi ng to this directory. Only one agent instance can safely write to a specific target directory at the same time. Unless file '.lock' is a leftover from an earlier proc ess that terminated abruptly, it is unsafe to delete it. For running multiple processes with agents at the same time to create a single configuration, read Agent.md o r https://www.graalvm.org/reference-manual/native-image/Agent/ on how to use the native-image-configure tool. :nativeRunAgent (Thread[Execution worker for ':',5,main]) completed. Took 0.387 secs.

rizeo commented 2 years ago

build.gradle

buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } // maven { // url 'https://nexus.gluonhq.com/nexus/content/repositories/releases' // } } dependencies { classpath "com.gluonhq:gluonfx-gradle-plugin:1.0.15" } }

plugins { // id 'java' id 'application' id 'org.openjfx.javafxplugin' version '0.0.13' id 'org.beryx.jlink' version '2.25.0' id "com.gluonhq.gluonfx-gradle-plugin" version "1.0.15" }

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

repositories { mavenCentral() }

ext { junitVersion = '5.8.2' }

sourceCompatibility = '11' targetCompatibility = '11'

tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }

application { mainModule = 'com.example.hellofjx' mainClassName = 'com.example.hellofjx.HelloApplication' }

javafx { version = '17.0.2' modules = ['javafx.controls', 'javafx.fxml'] }

dependencies {

testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")

}

apply plugin: "com.gluonhq.gluonfx-gradle-plugin"

test { useJUnitPlatform() }

jlink { imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip") options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] launcher { name = 'app' } }

jlinkZip { group = 'distribution' }

UndeadDevel commented 1 year ago

The error just means that the previous run crashed...you need to remove the .lock file manually.