You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started/oci/cloud-shell.md
+5-6
Original file line number
Diff line number
Diff line change
@@ -50,18 +50,18 @@ You are all set to run Java applications using Oracle GraalVM JDK in Cloud Shell
50
50
51
51
## Run a Java Application
52
52
53
-
The example is a minimal REST-based application, built on top of Spring Boot using Maven.
53
+
The example is a minimal REST-based application, built on top of Spring Boot 3 using Maven.
54
54
The _pom.xml_ file was generated using [Spring Initializr](https://start.spring.io/) with Spring Native Tools added as a feature.
55
55
The [Spring AOT plugin](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#spring-aot) performs ahead-of-time transformations of a Spring application into a native executable.
56
56
57
57
1. Clone the _demos_ repository and change to the application root directory:
2. Build the application with Maven (Apache Maven is also preinstalled in Cloud Shell):
63
63
```shell
64
-
mvn clean package
64
+
./mvnw clean package
65
65
```
66
66
This will generate a runnable JAR file that contains all of the application’s dependencies as well as a correctly configured `MANIFEST` file.
67
67
@@ -85,7 +85,7 @@ The [Spring AOT plugin](https://docs.spring.io/spring-native/docs/current/refere
85
85
86
86
4. Next, build a native executable for this Spring Boot application using the [`native` Maven profile](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html#quickstart).
87
87
```shell
88
-
mvn -Pnative native:compile
88
+
./mvnw -Pnative native:compile
89
89
```
90
90
This will generate a native executable forLinuxin the _target_ directory, named _benchmark-jibber_.
91
91
@@ -115,5 +115,4 @@ Thus, you can use Oracle GraalVM in OCI Cloud Shell to build and test simple Jav
115
115
- [Java Hello World with Oracle GraalVM in OCI Cloud Shell](https://github.com/graalvm/graalvm-demos/blob/master/java-hello-world-maven/README-Cloud-Shell.md)
116
116
- [Micronaut Hello World REST App with Oracle GraalVM in OCI Cloud Shell](https://github.com/graalvm/graalvm-demos/blob/master/micronaut-hello-rest-maven/README-Cloud-Shell.md)
117
117
- [Spring Boot Microservice with Oracle GraalVM in OCI Cloud Shell](https://github.com/graalvm/graalvm-demos/blob/master/spring-native-image/README-Cloud-Shell.md)
118
-
- [Oracle GraalVM in OCI Code Editor](code-editor.md)
119
-
118
+
- [Oracle GraalVM in OCI Code Editor](code-editor.md)
@@ -109,10 +109,10 @@ The generated native executable is platform-dependent.
109
109
110
110
In this guide, you saw how to use GraalVM container images to containerize a native executable for your Java application.
111
111
112
-
With GraalVM Native Image you can build a statically linked native executable by packaging the native executable directly into tiny containers such as scratch or distroless images.
112
+
With GraalVM Native Image you can also [build fully static native executables](build-static-and-mostly-static-executable.md) and package them directly into tiny containers such as scratch or distroless containers.
113
113
114
114
### Related Documentation
115
115
116
-
* [Build a Static or Mostly-Static Native Executable](build-static-and-mostly-static-executable.md)
*<a href="https://luna.oracle.com/lab/fdfd090d-e52c-4481-a8de-dccecdca7d68" target="_blank">Hands-on Lab: GraalVM Native Image, Spring and Containerisation</a>
116
+
* [Build a Native Executable from a Spring Boot Application](build-spring-boot-application-aot.md)
*<a href="https://luna.oracle.com/lab/fdfd090d-e52c-4481-a8de-dccecdca7d68" target="_blank">Hands-on Lab: GraalVM Native Image, Spring and Containerisation</a>
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/guides/create-heap-dump-from-native-executable.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ All approaches are described below.
25
25
> Note: By default, a heap dump is created in the current working directory. The `-XX:HeapDumpPath` option can be used to specify an alternative filename or directory. For example:
The agent captures and records calls to the H2 Database and all the dynamic features encountered during a test run into the _reachability-metadata.json_ file in the _target/native/agent-output/main/_ directory.
335
333
336
334
4. Build a native executable using configuration collected by the agent:
It generates a native executable for the platform in the _target/_ directory, called _h2example_.
341
339
@@ -346,7 +344,8 @@ In the `native` Maven profile section, add the `exec-maven-plugin` plugin:
346
344
347
345
### Summary
348
346
349
-
This guide demonstrated how to build a native executable using the [GraalVM Reachability Metadata Repository](https://github.com/oracle/graalvm-reachability-metadata) and with the Tracing Agent. The goal was to show the difference, and prove how using the reachability metadata can simplify the work.
347
+
This guide demonstrated how to build a native executable using the [GraalVM Reachability Metadata Repository](https://github.com/oracle/graalvm-reachability-metadata) and with the Tracing Agent.
348
+
The goal was to show the difference, and prove how using the reachability metadata can simplify the work.
350
349
Using the GraalVM Reachability Metadata Repository enhances the usability of Native Image for Java applications depending on 3rd party libraries.
int r =RANDOM.nextInt(fortunes.size()); //Pick a random number
51
-
String f = fortunes.get(r); //Use the random number to pick a random fortune
50
+
int r =RANDOM.nextInt(fortunes.size()); //Pick a random number
51
+
String f = fortunes.get(r); //Use the random number to pick a random fortune
52
52
for (char c: f.toCharArray()) { // Print out the fortune
53
53
System.out.print(c);
54
54
Thread.sleep(100);
@@ -93,11 +93,12 @@ In the following example, you run a "fortune teller" application that simulates
93
93
94
94
To see which resources were included in your native executable, pass the option `--emit build-report` to the `native-image` tool at build time.
95
95
It generates an HTML file that can be examined with a regular web browser.
96
-
The information about all included resources will be under the `Resources` tab.
96
+
The information about all included resources will be under the **Resources** tab.
97
97
98
-
Inthis demo the path to the resource file is straightforward, but it may be more complex in a real-world use case.
99
-
Resources are specified via globs. For more advanced use-cases, you can register resources using the API methods (see [classRuntimeResourceAccess](https://www.graalvm.org/sdk/javadoc/org/graalvm/nativeimage/hosted/RuntimeResourceAccess.html)).
100
-
Learn more about specifying a resource path using a glob and some syntax rules to be observed from [Accessing Resources in Native Image](../ReachabilityMetadata.md#resources).
98
+
Inthis demo the path to the resource file is straightforward, but it may be more complex in real-world use cases.
99
+
Resources are specified via globs.
100
+
For more advanced use-cases, you can register resources using the API methods (see [classRuntimeResourceAccess](https://www.graalvm.org/sdk/javadoc/org/graalvm/nativeimage/hosted/RuntimeResourceAccess.html)).
101
+
Learn more about specifying a resource path using a glob and some syntax rules to be observed in [Accessing Resources in Native Image](../ReachabilityMetadata.md#resources).
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/guides/optimize-file-size.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -27,14 +27,14 @@ For the demo, run a "fortune teller" application that simulates the traditional
27
27
28
28
2. Change directory to _fortune-demo/fortune-maven_:
29
29
```bash
30
-
cdfortune-demo/fortune-maven
30
+
cdnative-image/native-build-tools/maven-plugin
31
31
```
32
32
33
33
## Build a Native Executable with Default Configuration
34
34
35
-
1. Create a native executable using the [Maven plugin for Native Image](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html){:target="_blank"}:
35
+
1. Create a native executable using the [Maven plugin for Native Image building](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html){:target="_blank"}:
36
36
```bash
37
-
mvn -Pnative package
37
+
./mvnw -Pnative package
38
38
```
39
39
The command compiles the project, creates a JAR file with all dependencies, and then generates a native executable, `fortune`, in the _target_ directory.
40
40
@@ -53,7 +53,7 @@ For the demo, run a "fortune teller" application that simulates the traditional
53
53
54
54
Next create a native executable with the size optimization on, giving a different name for the output file to differentiate it from the previous build.
55
55
56
-
1. Open the _pom.xml_ file. Find the `native-maven-plugin` declaration, and add the following build arguments within the `<configuration>` element. The configuration should look like this:
56
+
1. Open the _pom.xml_ file. Find the `native-maven-plugin` declaration, and notice the following build arguments within the `<configuration>` element:
57
57
```xml
58
58
<configuration>
59
59
<imageName>fortune-optimized</imageName>
@@ -68,7 +68,7 @@ Next create a native executable with the size optimization on, giving a differen
68
68
69
69
2. Create the second native executable:
70
70
```bash
71
-
mvn -Pnative package
71
+
./mvnw -Pnative package
72
72
```
73
73
The command generates an executable file, `fortune-optimized`, in the _target_ directory.
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/guides/optimize-native-executable-size-using-build-report.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -65,10 +65,10 @@ The words are delimited by commas and may be enclosed by an arbitrary number of
65
65
native-image IthWord --emit build-report
66
66
```
67
67
68
-
The command generates an executable file, `_ithword_`, in the current working directory.
68
+
The command generates an executable file, `ithword`, in the current working directory.
69
69
The Build Report file, _ithword-build-report.html_, is automatically created alongside the native executable.
70
70
A link to the report is also listed in the _Build artifacts_ section at the end of the build output.
71
-
You can specify a different filename or path for the report by appending it to the `build-report` argument, for example, `--emit build-report=/tmp/custom-name-build-report.html`.
71
+
You can specify a different filename or path for the report by appending it to the `build-report` option, for example, `--emit build-report=/tmp/custom-name-build-report.html`.
72
72
73
73
(Optional) Run this executable with the same argument:
0 commit comments