I am using spring boot 3.0.2 and I am using native-maven-plugin.
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.9.19</version>
</plugin>
when I try to build a graalvm native image with this command
./mvnw -Pnative spring-boot:build-image
The process runs for a while and then it is just waiting at this stage forever.
[INFO] [creator] Executing native-image -H:+StaticExecutableWithDynamicLibC #/workspace/META-INF/native-image/argfile -H:Name=/layers/paketo-buildpacks_native-image/native-image/com.example.spring6.Spring6Application -cp /workspace:/workspace/BOOT-INF/classes:/workspace/BOOT-INF/lib/spring-boot-3.0.2.jar:/workspace/BOOT-INF/lib/spring-boot-autoconfigure-3.0.2.jar:/workspace/BOOT-INF/lib/logback-classic-1.4.5.jar:/workspace/BOOT-INF/lib/logback-core-1.4.5.jar:/workspace/BOOT-INF/lib/log4j-to-slf4j-2.19.0.jar:/workspace/BOOT-INF/lib/log4j-api-2.19.0.jar:/workspace/BOOT-INF/lib/jul-to-slf4j-2.0.6.jar:/workspace/BOOT-INF/lib/jakarta.annotation-api-2.1.1.jar:/workspace/BOOT-INF/lib/snakeyaml-1.33.jar:/workspace/BOOT-INF/lib/jackson-databind-2.14.1.jar:/workspace/BOOT-INF/lib/jackson-annotations-2.14.1.jar:/workspace/BOOT-INF/lib/jackson-core-2.14.1.jar:/workspace/BOOT-INF/lib/jackson-datatype-jdk8-2.14.1.jar:/workspace/BOOT-INF/lib/jackson-datatype-jsr310-2.14.1.jar:/workspace/BOOT-INF/lib/jackson-module-parameter-names-2.14.1.jar:/workspace/BOOT-INF/lib/tomcat-embed-core-10.1.5.jar:/workspace/BOOT-INF/lib/tomcat-embed-el-10.1.5.jar:/workspace/BOOT-INF/lib/tomcat-embed-websocket-10.1.5.jar:/workspace/BOOT-INF/lib/spring-web-6.0.4.jar:/workspace/BOOT-INF/lib/spring-beans-6.0.4.jar:/workspace/BOOT-INF/lib/micrometer-observation-1.10.3.jar:/workspace/BOOT-INF/lib/micrometer-commons-1.10.3.jar:/workspace/BOOT-INF/lib/spring-webmvc-6.0.4.jar:/workspace/BOOT-INF/lib/spring-aop-6.0.4.jar:/workspace/BOOT-INF/lib/spring-context-6.0.4.jar:/workspace/BOOT-INF/lib/spring-expression-6.0.4.jar:/workspace/BOOT-INF/lib/reactor-netty-http-1.1.2.jar:/workspace/BOOT-INF/lib/netty-codec-http-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-common-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-buffer-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-transport-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-codec-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-handler-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-codec-http2-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-resolver-dns-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-resolver-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-codec-dns-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-resolver-dns-native-macos-4.1.87.Final-osx-x86_64.jar:/workspace/BOOT-INF/lib/netty-resolver-dns-classes-macos-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-transport-native-epoll-4.1.87.Final-linux-x86_64.jar:/workspace/BOOT-INF/lib/netty-transport-native-unix-common-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-transport-classes-epoll-4.1.87.Final.jar:/workspace/BOOT-INF/lib/reactor-netty-core-1.1.2.jar:/workspace/BOOT-INF/lib/netty-handler-proxy-4.1.87.Final.jar:/workspace/BOOT-INF/lib/netty-codec-socks-4.1.87.Final.jar:/workspace/BOOT-INF/lib/spring-webflux-6.0.4.jar:/workspace/BOOT-INF/lib/reactor-core-3.5.2.jar:/workspace/BOOT-INF/lib/reactive-streams-1.0.4.jar:/workspace/BOOT-INF/lib/slf4j-api-2.0.6.jar:/workspace/BOOT-INF/lib/spring-core-6.0.4.jar:/workspace/BOOT-INF/lib/spring-jcl-6.0.4.jar:/workspace/BOOT-INF/lib/spring-boot-jarmode-layertools-3.0.2.jar com.example.spring6.Spring6Application
I am using macbook pro m1. My java version
openjdk version "17.0.6" 2023-01-17
OpenJDK Runtime Environment GraalVM CE 22.3.1 (build 17.0.6+10-jvmci-22.3-b13)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.1 (build 17.0.6+10-jvmci-22.3-b13, mixed mode, sharing)
For native image command is mvn -Pnative native:compile
With the native profile active, you can invoke the native:compile goal to trigger native-image compilation:
$ mvn -Pnative native:compile
The native image executable can be found in the target directory.
Source
The command you used is spring-boot:build-image which is generating docker image and running the native image under docker. if that command is stucking at some point it means docker is not responding or something freezing that side. Check this doc for further details.
Last note please do not use version number in native-maven-plugin plugin. pom should look like this
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
Related
I'm trying to figure out how to use the GraalVM native image agent with a Quarkus app running via mvn quarkus:dev.
I tried running:
mvn quarkus:dev -Djvm.args="-agentlib:native-image-agent=config-output-dir=native-image-config"
However I get the error:
ERROR: JDWP unable to get necessary JVMTI capabilities.
Any tips?
My version of Java:
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment GraalVM CE 20.2.0 (build 11.0.8+10-jvmci-20.2-b03)
OpenJDK 64-Bit Server VM GraalVM CE 20.2.0 (build 11.0.8+10-jvmci-20.2-b03, mixed mode, sharing)
By default mvn quarkus:dev enables debug with -Xrunjdwp, something like -Xrunjdwp:transport=dt_socket,address=0.0.0.0:5005,server=y,suspend=n
Then you stumble upon an issue described in this answer -- in short JDWP and JVMTI don't seem to work together well.
You can disable debug with passing -Ddebug=false and then it works. Something like this:
mvn quarkus:dev -Ddebug=false -Djvm.args="-agentlib:native-image-agent=config-output-dir=native-image-config"
I want to use JDK11 in Gradle for compiling my project without modifying JDK_HOME, which points to JDK10. I'm using JDK10 for most projects, but testing an upgrade to JDK11 in Gradle.
JAVA_HOME=C:\Program Files\Java\jdk-10.0.2
In /.gradle/gradle.properties I set the following property:
org.gradle.java.home=C:/Program Files/Java/jdk-11.0.3
when I run the command: gradle properties, I see the following line:
org.gradle.java.home: C:/Program Files/Java/jdk-11.0.3
but when I run the command: gradle -version, I see this, showing JVM is version 10:
------------------------------------------------------------
Gradle 5.4.1
------------------------------------------------------------
Build time: 2019-04-26 08:14:42 UTC
Revision: 261d171646b36a6a28d5a19a69676cd098a4c19d
Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 10.0.2 ("Oracle Corporation" 10.0.2+13)
OS: Windows 10 10.0 amd64
Despite is saying JDK10 above, is it still compiling in JDK11 and JVM only means the Java version used to run the Gradle Daemon?
The version reported by gradle -version is the one of the client VM executing that command.
Normally, Gradle will otherwise use a daemon process to execute your build. That process will respect the org.gradle.java.home setting.
Note that you can also have a finer control on which Java executable is used for the different tasks in Gradle. See the documentation for details.
How to issue a mvn command (for example to install an oracle driver) when standalone maven installation is not installed because I'm using the plugin in eclipse neon?
With Run as -> Maven build you can run arbitrary Maven commands. Just leave out the mvn at the beginning.
I've been trying to build the kylo (ver 0.8.4) project using maven on my windows machine, using the new bash feature, and following the instructions on the dev docs site.
I'm running into this situation where there's a spec file being created, and its been stuck at that message for the last hour. I've attached a screenshot
Can someone help me with this please?
Cheers
This is where Kylo is building an RPM artifact for installing on RedHat type systems. It requires the rpmbuild package which is unavailable on Windows.
Please see the Kylo Developer Guide for more information:
The assumption is that you are installing on a Mac or Linux box. You can do most activities below on a Windows box, except to perform a Maven build with the RPM install.
http://kylo.readthedocs.io/en/latest/developer-guides/KyloDeveloperGuide.html
You have a couple options:
1) Build Kylo up to the kylo-install-tar module:
mvn -am -pl install/install-tar package -DskipTests
2) Try compiling within the Kylo sandbox or a Linux VM.
I am trying to use Atlassian SDK 6.2.9. on my laptop with Win10, but there is a maven problem.
Java:1.8.0_101
Mvn: 3.3.9 (M2_HOME)
CMD full stack says more:
c:\>atlas-version
ATLAS Version: 6.2.9
ATLAS Home: C:\ProgramData\Atlassian\atlassian-plugin-sdk-6.2.9
ATLAS Scripts: C:\ProgramData\Atlassian\atlassian-plugin-sdk-6.2.9\bin
ATLAS Maven Home: C:\ProgramData\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1
AMPS Version: 6.2.6
--------
Executing: "C:\ProgramData\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1\bin\mvn.bat" --version -gs C:\ProgramData\Atlassian\atlassian-plugin-sdk-6.2.9\apache-maven-3.2.1/conf/settings.xml
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
-Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable and mvn script match.c:\>
My question is how can I figure this mvn problem out?
Thanks a lot