首頁 >Java >java教程 >原生鏡像快速參考 — GraalVM for JDK - graalvm

原生鏡像快速參考 — GraalVM for JDK - graalvm

DDD
DDD原創
2024-11-15 02:36:02298瀏覽

Adding below to your pom xml and

<profile>
    <id>native</id>
    <build>
      <plugins>
        <plugin>
          <groupId>org.graalvm.buildtools</groupId>
          <artifactId>native-maven-plugin</artifactId>
          <version>${buildtools.version}</version>
          <executions>
            <execution>
              <id>build-native</id>
              <goals>
                <goal>compile-no-fork</goal>
              </goals>
              <phase>package</phase>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
  </profile>
</profiles>

run command ./mvnw -Pnative package

Native Image Quick Reference — GraalVM for JDK - graalvm

Below you can see nice starters for different type of native binary graalvm supported projects.

JavaFX (GUI)

https://start.gluon.io/

Spring (microservices or everything)

https://start.spring.io/#!type=maven-project&language=java&platformVersion=3.3.5&packaging=jar&jvmVersion=21&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=native

Quarkus (micro services)

https://code.quarkus.io/

Reference:

  • https://medium.com/graalvm/native-image-quick-reference-graalvm-for-jdk-23-45cb94b65bf7

以上是原生鏡像快速參考 — GraalVM for JDK - graalvm的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn