Skip to content

Commit 56cc1b5

Browse files
[GR-60094] Move java-hello-world-maven to clouds/native-oci-cloud-shell. (#333)
* Move java-hello-world-maven to clouds/native-oci-cloud-shell * Text correction in compiler/java-stream-benchmark/README.md * Minor update * Minor update * Minor update * Minor update * Minor update --------- Co-authored-by: Sachin Pikle <sachin.pikle@oracle.com>
1 parent d87389b commit 56cc1b5

File tree

11 files changed

+529
-40
lines changed

11 files changed

+529
-40
lines changed

.github/workflows/java-hello-world-maven.yml renamed to .github/workflows/clouds-native-oci-cloud-shell.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1-
name: java-hello-world-maven
1+
name: clouds/native-oci-cloud-shell
22
on:
33
push:
44
paths:
5-
- 'java-hello-world-maven/**'
6-
- '.github/workflows/java-hello-world-maven.yml'
7-
# pull_request: (requires EE, which is unavailable in PRs)
5+
- 'clouds/native-oci-cloud-shell/**'
6+
- '.github/workflows/clouds-native-oci-cloud-shell.yml'
87
schedule:
98
- cron: "0 0 1 * *" # run every month
109
workflow_dispatch:
1110
permissions:
1211
contents: read
1312
jobs:
1413
run:
15-
name: Run 'java-hello-world-maven'
14+
name: Run 'clouds/native-oci-cloud-shell'
1615
runs-on: ubuntu-latest
1716
timeout-minutes: 15
1817
steps:
1918
- uses: actions/checkout@v4
2019
- uses: graalvm/setup-graalvm@v1
2120
with:
22-
java-version: '21.0.2'
21+
java-version: '21'
2322
distribution: 'graalvm'
2423
github-token: ${{ secrets.GITHUB_TOKEN }}
2524
cache: 'maven'
2625
native-image-job-reports: 'true'
27-
- name: Run 'java-hello-world-maven'
26+
- name: Run 'clouds/native-oci-cloud-shell'
2827
run: |
29-
cd java-hello-world-maven
28+
cd clouds/native-oci-cloud-shell
3029
mvn --no-transfer-progress clean package
3130
java -jar target/my-app-1.0-SNAPSHOT.jar
3231
mvn --no-transfer-progress clean -Pnative -DskipTests package

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
The output should be similar to (versions may vary):
4848

4949
```shell
50-
java version "17.0.9" 2023-10-17 LTS
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)
50+
java version "17.0.13" 2024-10-15 LTS
51+
Java(TM) SE Runtime Environment Oracle GraalVM 17.0.13+10.1 (build 17.0.13+10-LTS-jvmci-23.0-b49)
52+
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.13+10.1 (build 17.0.13+10-LTS-jvmci-23.0-b49, mixed mode, sharing)
5353
```
5454

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

6363
```shell
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)
64+
native-image 17.0.13 2024-10-15
65+
GraalVM Runtime Environment Oracle GraalVM 17.0.13+10.1 (build 17.0.13+10-LTS-jvmci-23.0-b49)
66+
Substrate VM Oracle GraalVM 17.0.13+10.1 (build 17.0.13+10-LTS, serial gc, compressed references)
6767
```
6868

6969
6. Confirm the `Java` used for Maven builds:
@@ -76,7 +76,7 @@
7676

7777
```shell
7878
...
79-
Java version: 17.0.9, vendor: Oracle Corporation, runtime: /usr/lib64/graalvm/graalvm-java17
79+
Java version: 17.0.13, vendor: Oracle Corporation, runtime: /usr/lib64/graalvm/graalvm-java17
8080
...
8181
```
8282

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar

java-hello-world-maven/README-Cloud-Shell.md renamed to clouds/native-oci-cloud-shell/README-Cloud-Shell.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Oracle GraalVM is available for use on Oracle Cloud Infrastructure (OCI) at no a
1010

1111
## What is Cloud Shell?
1212

13-
[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.
13+
[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.
1414

1515
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

@@ -46,39 +46,37 @@ Oracle GraalVM for JDK 17 (with Native Image) is preinstalled in Cloud Shell, so
4646
The current managed java version is set to graalvmjdk-17.
4747
```
4848

49-
## Step 3: [OPTIONAL] Confirm software version and environment variables
50-
51-
This step is optional - [Check software version and environment variables](../_common/README-check-version-env-vars.md)
52-
53-
54-
## Step 4: Set up your project, build and run as a JAR
49+
## Step 3: Set up your project, build and run as a JAR
5550

5651
1. Git clone this example.
5752

5853
```shell
59-
git init graalvmee-java-hello-world-maven
54+
git init graalvm-native-oci-cloud-shell
6055
61-
cd graalvmee-java-hello-world-maven
56+
cd graalvm-native-oci-cloud-shell
6257
6358
git remote add origin https://github.com/graalvm/graalvm-demos.git
6459
6560
git config core.sparsecheckout true
6661
67-
echo "java-hello-world-maven/*">>.git/info/sparse-checkout
62+
echo "clouds/native-oci-cloud-shell/*">>.git/info/sparse-checkout
6863
6964
git pull --depth=1 origin master
7065
71-
cd java-hello-world-maven
72-
66+
cd clouds/native-oci-cloud-shell
7367
```
7468

75-
2. Build a JAR file for the example app.
69+
2. [OPTIONAL] Confirm software version and environment variables.
70+
71+
[Check software version and environment variables](../../_common/README-check-version-env-vars.md)
72+
73+
3. Build a JAR file for the example app.
7674

7775
```shell
78-
mvn clean package
76+
./mvnw clean package
7977
```
8078

81-
3. Run the JAR using:
79+
4. Run the JAR:
8280

8381
```shell
8482
java -jar target/my-app-1.0-SNAPSHOT.jar
@@ -90,7 +88,7 @@ This step is optional - [Check software version and environment variables](../_c
9088
Hello World!
9189
```
9290

93-
## Step 5: Build and run a native executable
91+
## Step 4: Build and run a native executable
9492

9593
Use GraalVM Native Image to produce a native executable.
9694

@@ -107,7 +105,7 @@ You will notice the `Quick Build` mode reduces the time required to generate a n
107105
2. Use the Native Image maven plugin to create a native executable:
108106

109107
```shell
110-
mvn clean -Pnative -DskipTests package
108+
./mvnw clean -Pnative -DskipTests package
111109
```
112110

113111
3. Run the native executable using:
@@ -134,7 +132,7 @@ You will notice the `Quick Build` mode reduces the time required to generate a n
134132
2. Use the Native Image maven plugin to create a native executable:
135133

136134
```shell
137-
mvn clean -Pnative -DskipTests package
135+
./mvnw clean -Pnative -DskipTests package
138136
```
139137

140138
3. Run the native executable using:
@@ -148,3 +146,5 @@ You will notice the `Quick Build` mode reduces the time required to generate a n
148146
```text
149147
Hello World!
150148
```
149+
150+
Learn how to start using Oracle GraalVM with other OCI services at [docs.oracle.com](https://docs.oracle.com/en/graalvm/jdk/23/docs/getting-started/oci/).

java-hello-world-maven/README.md renamed to clouds/native-oci-cloud-shell/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

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

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

0 commit comments

Comments
 (0)