Skip to content

Commit fa897f5

Browse files
authored
Switch from GraalVM EE to Oracle GraalVM (#249)
1 parent 95076d9 commit fa897f5

File tree

10 files changed

+94
-88
lines changed

10 files changed

+94
-88
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ cd graalvm-demos
177177
<tbody>
178178
<tr>
179179
<td align="left" width="30%"><a href="/spring-native-image/">spring-native-image</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/spring-native-image.yml"><img alt="spring-native-image" src="https://github.com/graalvm/graalvm-demos/actions/workflows/spring-native-image.yml/badge.svg" /></a></td>
180-
<td align="left" width="70%">Demonstrates how to compile a Spring Boot application into a native executable using the Native Build Tools Maven plugin and a Maven profile <br> <strong>Technologies: </strong>Spring Boot, Native Image, Native Build Tools Maven plugin <br><strong>Reference: </strong><a href="https://luna.oracle.com/lab/fdfd090d-e52c-4481-a8de-dccecdca7d68/steps">GraalVM Native Image, Spring and Containerisation</a>, <a href="https://docs.oracle.com/en/graalvm/jdk/21/docs/getting-started/oci/cloud-shell/">GraalVM Enterprise in OCI Cloud Shell</a></td>
180+
<td align="left" width="70%">Demonstrates how to compile a Spring Boot application into a native executable using the Native Build Tools Maven plugin and a Maven profile <br> <strong>Technologies: </strong>Spring Boot, Native Image, Native Build Tools Maven plugin <br><strong>Reference: </strong><a href="https://luna.oracle.com/lab/fdfd090d-e52c-4481-a8de-dccecdca7d68/steps">GraalVM Native Image, Spring and Containerisation</a>, <a href="https://docs.oracle.com/en/graalvm/jdk/21/docs/getting-started/oci/cloud-shell/">Oracle GraalVM in OCI Cloud Shell</a></td>
181181
</tr>
182182
<tr>
183183
<td align="left" width="30%"><a href="/spring-r/">spring-r</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/spring-r.yml"><img alt="spring-r" src="https://github.com/graalvm/graalvm-demos/actions/workflows/spring-r.yml/badge.svg" /></a></td>

_common/README-check-version-env-vars.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## [OPTIONAL] Confirm software version and environment variables
1+
## [OPTIONAL] Confirm Software Version and Environment Variables
22

33
1. Confirm GraalVM is the current JDK:
44

@@ -9,9 +9,9 @@
99
The output should be similar to (versions may vary):
1010

1111
```shell
12-
* graalvmeejdk-17 /usr/lib64/graalvm/graalvm22-ee-java17
13-
oraclejdk-1.8 /usr/java/jdk1.8.0_351-amd64
12+
* graalvmjdk-17 /usr/lib64/graalvm/graalvm-java17
1413
oraclejdk-11 /usr/java/jdk-11.0.17
14+
oraclejdk-1.8 /usr/lib/jvm/jdk-1.8-oracle-x64
1515
```
1616

1717
2. Confirm the environment variable `JAVA_HOME` is set correctly:
@@ -23,7 +23,7 @@
2323
The output should be similar to:
2424

2525
```shell
26-
/usr/lib64/graalvm/graalvm22-ee-java17
26+
/usr/lib64/graalvm/graalvm-java17
2727
```
2828

2929
3. Confirm the environment variable `PATH` is set correctly:
@@ -35,7 +35,7 @@
3535
The output should be similar to:
3636

3737
```shell
38-
/usr/lib64/graalvm/graalvm22-ee-java17/bin/:...
38+
/usr/lib64/graalvm/graalvm-java17/bin/:...
3939
```
4040

4141
4. Confirm the `java` version:
@@ -48,8 +48,8 @@
4848

4949
```shell
5050
java version "17.0.9" 2023-10-17 LTS
51-
Java(TM) SE Runtime Environment GraalVM EE 22.3.4 (build 17.0.9+11-LTS-jvmci-22.3-b28)
52-
Java HotSpot(TM) 64-Bit Server VM GraalVM EE 22.3.4 (build 17.0.9+11-LTS-jvmci-22.3-b28, mixed mode, sharing)
51+
Java(TM) SE Runtime Environment Oracle GraalVM 17.0.9+11.1 (build 17.0.9+11-LTS-jvmci-23.0-b21)
52+
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.9+11.1 (build 17.0.9+11-LTS-jvmci-23.0-b21, mixed mode, sharing)
5353
```
5454

5555
5. Confirm the `native-image` version:
@@ -61,7 +61,9 @@
6161
The output should be similar to (versions may vary):
6262

6363
```shell
64-
GraalVM 22.3.4 Java 17 EE (Java Version 17.0.9+11-LTS-jvmci-22.3-b28)
64+
native-image 17.0.9 2023-10-17
65+
GraalVM Runtime Environment Oracle GraalVM 17.0.9+11.1 (build 17.0.9+11-LTS-jvmci-23.0-b21)
66+
Substrate VM Oracle GraalVM 17.0.9+11.1 (build 17.0.9+11-LTS, serial gc, compressed references)
6567
```
6668

6769
6. Confirm the `Java` used for Maven builds:
@@ -74,7 +76,7 @@
7476

7577
```shell
7678
...
77-
Java version: 17.0.9, vendor: Oracle Corporation, runtime: /usr/lib64/graalvm/graalvm22-ee-java17
79+
Java version: 17.0.9, vendor: Oracle Corporation, runtime: /usr/lib64/graalvm/graalvm-java17
7880
...
7981
```
8082

java-hello-world-maven/README-Cloud-Shell.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# Java Hello World with GraalVM Enterprise in OCI Cloud Shell
1+
# Java Hello World with Oracle GraalVM in OCI Cloud Shell
22

3-
This example shows how you can get started quickly with GraalVM Enterprise Edition in Oracle Cloud Infrastructre (OCI) Cloud Shell. This example uses a simple hello world Java application built with GraalVM Enterprise Native Image and JDK (Java Development Kit).
3+
This example shows how you can get started quickly with Oracle GraalVM in Oracle Cloud Infrastructure (OCI) Cloud Shell. This example uses a simple hello world Java application built with Oracle GraalVM Native Image and JDK (Java Development Kit).
44

55
## What is GraalVM?
66

77
[GraalVM](https://www.oracle.com/in/java/graalvm/) is a high-performance JDK distribution that accelerates Java workloads. GraalVM Native Image ahead-of-time compilation builds your Java application into a native executable that is small, starts fast, and uses less memory and CPU. Leading Java microservices frameworks such as Spring Boot, Micronaut, Quarkus and Helidon support GraalVM Native Image.
88

9-
GraalVM Enterprise Edition is available for use on Oracle Cloud Infrastructure (OCI) at no additional cost.
9+
Oracle GraalVM is available for use on Oracle Cloud Infrastructure (OCI) at no additional cost.
1010

1111
## What is Cloud Shell?
1212

1313
[Cloud Shell](https://www.oracle.com/devops/cloud-shell/) is a free-to-use browser-based terminal accessible from the Oracle Cloud Console. It provides access to a Linux shell with preinstalled developer tools and a preauthenticated OCI CLI. You can use the shell to interact with OCI resources, follow labs and tutorials, and quickly run utility commands.
1414

15-
GraalVM Enterprise JDK 17 and Native Image are preinstalled in Cloud Shell, so you don’t have to install and configure a development machine to get started.
15+
Oracle GraalVM for JDK 17 (with Native Image) is preinstalled in Cloud Shell, so you don’t have to install and configure a development machine to get started.
1616

17-
## Step 1: Launch Cloud Shell
17+
## Step 1: Launch Cloud Shell
1818

1919
1. [Login to OCI Console and launch Cloud Shell](https://cloud.oracle.com/?bdcstate=maximized&cloudshell=true).
2020

21-
## Step 2: Select GraalVM as the current JDK
21+
## Step 2: Select GraalVM as the current JDK
2222

2323
1. List the installed JDKs:
2424

@@ -29,21 +29,21 @@ GraalVM Enterprise JDK 17 and Native Image are preinstalled in Cloud Shell, so y
2929
The output should be similar to:
3030

3131
```shell
32-
graalvmeejdk-17 /usr/lib64/graalvm/graalvm22-ee-java17
33-
* oraclejdk-1.8 /usr/java/jdk1.8.0_351-amd64
34-
oraclejdk-11 /usr/java/jdk-11.0.17
32+
graalvmjdk-17 /usr/lib64/graalvm/graalvm-java17
33+
* oraclejdk-11 /usr/java/jdk-11.0.17
34+
oraclejdk-1.8 /usr/lib/jvm/jdk-1.8-oracle-x64
3535
```
3636

3737
2. Select GraalVM as the current JDK:
3838

3939
```shell
40-
csruntimectl java set graalvmeejdk-17
40+
csruntimectl java set graalvmjdk-17
4141
```
4242

4343
The output should be similar to:
4444

4545
```shell
46-
The current managed java version is set to graalvmeejdk-17.
46+
The current managed java version is set to graalvmjdk-17.
4747
```
4848

4949
## Step 3: [OPTIONAL] Confirm software version and environment variables
@@ -85,7 +85,8 @@ This step is optional - [Check software version and environment variables](../_c
8585
```
8686

8787
The output should be similar to:
88-
```
88+
89+
```text
8990
Hello World!
9091
```
9192

@@ -99,8 +100,8 @@ You will notice the `Quick Build` mode reduces the time required to generate a n
99100

100101
1. To enable `Quick Build`, open [pom.xml](./pom.xml) in a text editor such as Nano and uncomment the line shown:
101102

102-
```
103-
<buildArg>-Ob</buildArg>
103+
```xml
104+
<quickBuild>true</quickBuild>
104105
```
105106

106107
2. Use the Native Image maven plugin to create a native executable:
@@ -116,17 +117,18 @@ You will notice the `Quick Build` mode reduces the time required to generate a n
116117
```
117118

118119
The output should be similar to:
119-
```
120+
121+
```text
120122
Hello World!
121123
```
122124

123125

124-
**Option 2: Quick Build disabled**
125-
126-
1. To disable `Quick Build`, open [pom.xml](pom.xml) in a text editor such as Nano and comment the line shown:
126+
**Option 2: Quick Build disabled**
127127

128-
```
129-
<!-- <buildArg>-Ob</buildArg> -->
128+
1. To disable `Quick Build`, open [pom.xml](pom.xml) in a text editor such as Nano and comment the line shown:
129+
130+
```xml
131+
<!-- <quickBuild>true</quickBuild> -->
130132
```
131133

132134
2. Use the Native Image maven plugin to create a native executable:
@@ -142,6 +144,7 @@ You will notice the `Quick Build` mode reduces the time required to generate a n
142144
```
143145

144146
The output should be similar to:
145-
```
147+
148+
```text
146149
Hello World!
147150
```

java-hello-world-maven/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Java Hello World with GraalVM Enterprise
1+
# Java Hello World with Oracle GraalVM
22

3-
In this example, you will build and run a "Hello World" Java application with
3+
In this example, you will build and run a "Hello World" Java application with:
44

5-
- [GraalVM Enterprise in OCI Code Editor](https://github.com/oracle-devrel/oci-code-editor-samples/tree/main/java-samples/graalvmee-java-hello-world)
6-
- [GraalVM Enterprise in OCI Cloud Shell](./README-Cloud-Shell.md)
5+
- [Oracle GraalVM in OCI Code Editor](https://github.com/oracle-devrel/oci-code-editor-samples/tree/main/java-samples/graalvmee-java-hello-world)
6+
- [Oracle GraalVM in OCI Cloud Shell](./README-Cloud-Shell.md)

java-hello-world-maven/pom.xml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<groupId>com.gvm.samples</groupId>
88
<artifactId>my-app</artifactId>
99
<version>1.0-SNAPSHOT</version>
10-
10+
1111
<name>my-app</name>
1212
<!-- FIXME change it to the project's website -->
13-
<url>http://www.example.com</url>
13+
<url>http://www.oracle.com</url>
1414

1515
<properties>
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -48,7 +48,7 @@
4848
</plugins>
4949
</pluginManagement>
5050
</build>
51-
51+
5252
<profiles>
5353
<profile>
5454
<id>native</id>
@@ -77,18 +77,16 @@
7777
</executions>
7878
<configuration>
7979
<imageName>my-app</imageName>
80+
<verbose>true</verbose>
81+
<!-- For Quick Build (22.1+) -->
82+
<!-- <quickBuild>true</quickBuild> -->
8083
<buildArgs>
8184
<buildArg>-H:+ReportExceptionStackTraces</buildArg>
85+
<!-- For mostly static native image (only on Linux AMD64 systems) -->
8286
<!-- <buildArg>-H:+StaticExecutableWithDynamicLibC</buildArg> -->
83-
<buildArg>--verbose</buildArg>
84-
<!-- For Quick Build (22.1+) -->
85-
<buildArg>-Ob</buildArg>
87+
<!-- To generate the Native Image build output JSON (22.3+) -->
88+
<buildArg>-H:BuildOutputJSONFile=build.json</buildArg>
8689
</buildArgs>
87-
<!-- Start: Workaround for 22.2: Disable the default Java Module Path using USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM -->
88-
<!-- <environment>
89-
<USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM>false</USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM>
90-
</environment> -->
91-
<!-- End: Workaround for 22.2: Disable the default Java Module Path using USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM -->
9290
</configuration>
9391
</plugin>
9492
</plugins>

micronaut-hello-rest-maven/README-Cloud-Shell.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Micronaut uses GraalVM Native Image to build lightweight Java applications that
1818

1919
[Cloud Shell](https://www.oracle.com/devops/cloud-shell/) is a free-to-use browser-based terminal accessible from the Oracle Cloud Console. It provides access to a Linux shell with preinstalled developer tools and a preauthenticated OCI CLI. You can use the shell to interact with OCI resources, follow labs and tutorials, and quickly run utility commands.
2020

21-
Oracle GraalVM Enterprise JDK 17 and Native Image are preinstalled in Cloud Shell, so you don’t have to install and configure a development machine to get started.
21+
Oracle GraalVM for JDK 17 (with Native Image) is preinstalled in Cloud Shell, so you don’t have to install and configure a development machine to get started.
2222

2323
## Step 1: Launch Cloud Shell
2424

@@ -35,21 +35,21 @@ Oracle GraalVM Enterprise JDK 17 and Native Image are preinstalled in Cloud Shel
3535
The output should be similar to (versions may vary):
3636

3737
```shell
38-
graalvmeejdk-17 /usr/lib64/graalvm/graalvm22-ee-java17
39-
* oraclejdk-1.8 /usr/java/jdk1.8.0_351-amd64
40-
oraclejdk-11 /usr/java/jdk-11.0.17
38+
graalvmjdk-17 /usr/lib64/graalvm/graalvm-java17
39+
* oraclejdk-11 /usr/java/jdk-11.0.17
40+
oraclejdk-1.8 /usr/lib/jvm/jdk-1.8-oracle-x64
4141
```
4242

4343
2. Select GraalVM as the current JDK:
4444

4545
```shell
46-
csruntimectl java set graalvmeejdk-17
46+
csruntimectl java set graalvmjdk-17
4747
```
4848

4949
The output should be similar to:
5050

5151
```shell
52-
The current managed java version is set to graalvmeejdk-17.
52+
The current managed java version is set to graalvmjdk-17.
5353
```
5454

5555
## Step 3: Set up your project, build and run as a JAR
@@ -73,7 +73,7 @@ Oracle GraalVM Enterprise JDK 17 and Native Image are preinstalled in Cloud Shel
7373
7474
```
7575

76-
2. [OPTIONAL] Confirm software version and environment variables.
76+
2. [OPTIONAL] Confirm software version and environment variables.
7777

7878
[Check software version and environment variables](../_common/README-check-version-env-vars.md)
7979

micronaut-hello-rest-maven/pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
<parent>
1111
<groupId>io.micronaut.platform</groupId>
1212
<artifactId>micronaut-parent</artifactId>
13-
<version>4.2.1</version>
13+
<version>4.2.3</version>
1414
</parent>
1515
<properties>
1616
<packaging>jar</packaging>
1717
<jdk.version>17</jdk.version>
1818
<release.version>17</release.version>
19-
<micronaut.version>4.2.1</micronaut.version>
19+
<micronaut.version>4.2.3</micronaut.version>
2020
<micronaut.runtime>netty</micronaut.runtime>
2121
<micronaut.aot.enabled>false</micronaut.aot.enabled>
2222
<micronaut.aot.packageName>com.example.aot.generated</micronaut.aot.packageName>
@@ -121,6 +121,8 @@
121121
<buildArg>-H:+ReportExceptionStackTraces</buildArg>
122122
<!-- For mostly static native image (only on Linux AMD64 systems) -->
123123
<!-- <buildArg>-H:+StaticExecutableWithDynamicLibC</buildArg> -->
124+
<!-- To generate the Native Image build output JSON (22.3+) -->
125+
<buildArg>-H:BuildOutputJSONFile=build.json</buildArg>
124126
</buildArgs>
125127
</configuration>
126128
</plugin>

spring-native-image/README-Cloud-Shell.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# Spring Boot Microservice with GraalVM Enterprise in OCI Cloud Shell
1+
# Spring Boot Microservice with Oracle GraalVM in OCI Cloud Shell
22

3-
This part shows how you can get started quickly with GraalVM Enterprise Edition in Oracle Cloud Infrastructure (OCI) Cloud Shell using the Spring Boot 3 microservice example.
3+
This part shows how you can get started quickly with Oracle GraalVM in Oracle Cloud Infrastructure (OCI) Cloud Shell using the Spring Boot 3 microservice example.
44

5-
GraalVM Enterprise Edition is available for use on Oracle Cloud Infrastructure (OCI) at no additional cost.
5+
Oracle GraalVM is available for use on Oracle Cloud Infrastructure (OCI) at no additional cost.
66

77
## What is Cloud Shell?
88

99
[Cloud Shell](https://www.oracle.com/devops/cloud-shell/) is a free-to-use browser-based terminal accessible from the Oracle Cloud Console. It provides access to a Linux shell with preinstalled developer tools and a pre-authenticated OCI CLI. You can use the shell to interact with OCI resources, follow labs and tutorials, and quickly run utility commands.
1010

11-
GraalVM Enterprise JDK 17 and Native Image are preinstalled in Cloud Shell, so you do not have to install and configure a development machine to get started.
11+
Oracle GraalVM for JDK 17 (with Native Image) is preinstalled in Cloud Shell, so you don’t have to install and configure a development machine to get started.
1212

13-
## Step 1: Launch Cloud Shell
13+
## Step 1: Launch Cloud Shell
1414

1515
[Login to OCI Console and launch Cloud Shell](https://cloud.oracle.com/?bdcstate=maximized&cloudshell=true).
1616

17-
## Step 2: Select GraalVM as the Current JDK
17+
## Step 2: Select GraalVM as the Current JDK
1818

1919
1. List the installed JDKs:
2020

@@ -25,20 +25,21 @@ GraalVM Enterprise JDK 17 and Native Image are preinstalled in Cloud Shell, so y
2525
The output should be similar to (versions may vary):
2626

2727
```shell
28-
graalvmeejdk-17 /usr/lib64/graalvm/graalvm22-ee-java17
29-
* oraclejdk-1.8 /usr/java/jdk1.8.0_351-amd64
30-
oraclejdk-11 /usr/java/jdk-11.0.17
28+
graalvmjdk-17 /usr/lib64/graalvm/graalvm-java17
29+
* oraclejdk-11 /usr/java/jdk-11.0.17
30+
oraclejdk-1.8 /usr/lib/jvm/jdk-1.8-oracle-x64
3131
```
3232

3333
2. Select GraalVM as the current JDK:
3434

3535
```shell
36-
csruntimectl java set graalvmeejdk-17
36+
csruntimectl java set graalvmjdk-17
3737
```
38+
3839
The output should be similar to:
3940

4041
```shell
41-
The current managed java version is set to graalvmeejdk-17.
42+
The current managed java version is set to graalvmjdk-17.
4243
```
4344

4445
## Step 3: (Optional) Confirm Software Version and Environment Variables
@@ -78,7 +79,7 @@ This step is optional - [Check software version and environment variables](../_c
7879
java -jar ./target/benchmark-jibber-0.0.1-SNAPSHOT.jar &
7980
```
8081

81-
4. Test the app JAR.
82+
4. Test the app JAR.
8283

8384
```shell
8485
curl http://localhost:8080/jibber
@@ -110,14 +111,14 @@ This step is optional - [Check software version and environment variables](../_c
110111

111112
## Step 5: Build and Run a Native Executable
112113

113-
Now build a native executable for your Spring Boot microservice using GraalVM Enterprise Native Image.
114+
Now build a native executable for your Spring Boot microservice using Oracle GraalVM Native Image.
114115

115116
1. Build the app native executable
116117

117118
```shell
118119
mvn -Pnative native:compile
119120
```
120-
121+
121122
This will create a binary executable `target/benchmark-jibber`.
122123

123124
2. Run the app native executable in the background

0 commit comments

Comments
 (0)