Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native-image-agent #161

Open
rizeo opened this issue Aug 17, 2022 · 2 comments
Open

native-image-agent #161

rizeo opened this issue Aug 17, 2022 · 2 comments

Comments

@rizeo
Copy link

rizeo commented Aug 17, 2022

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
Copy link
Author

rizeo commented Aug 17, 2022

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants