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
5. (Optional.) Add _module-info.java_ to your application.
155
+
If you would like to run your application on the module path, create a _module-info.java_ file in _src/main/java_ with the following contents:
156
+
```java
157
+
module com.example {
158
+
requires org.graalvm.polyglot;
159
+
}
160
+
```
161
+
162
+
6. Compile and package the project:
148
163
```bash
149
164
mvn clean package
150
165
```
166
+
167
+
7. Run the application using GraalVM or another compatible JDK.
168
+
If you've included _module-info.java_ in your project (step 5), you can now run the application on the module path, using one of the following commands:
A single JAR with all dependencies was created from language libraries.
156
-
However, we recommend splitting and using Java modules on the module path, especially if you would like to compile this application ahead of time with GraalVM Native Image.
186
+
> Note: We discourage bundling all dependencies into a single "fat" JAR (for example, using the Maven Assembly plugin) as it can cause issues and prevent ahead-of-time compilation with [GraalVM Native Image](https://www.graalvm.org/reference-manual/native-image/).
187
+
> Instead, we recommend using the original, separate JAR files for all `org.graalvm.*` dependencies, preferably on the module path.
157
188
Learn more in the [Guide to Embedding Languages](https://www.graalvm.org/reference-manual/embed-languages/#dependency-setup).
158
189
159
190
The source code unit can be represented with a String, as shown in the example, a file, read from URL, and [other means](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/Source.html).
0 commit comments