Demonstration repository showing polyglot embedding with GraalVM JDK 21 using Maven and Gradle. It contains a simple Main and Test class to bootstrap a polyglot embedding project.
For demonstration showing polyglot native embedding with GraalVM JDK 21 using Maven, see
the Native embedding Maven project located in the native-embedding
subdirectory.
For more details on polyglot embedding please see the docs: https://www.graalvm.org/latest/reference-manual/embed-languages/
Download GraalVM and point the JAVA_HOME
environment variable to it.
Download Maven or import as Maven project into your IDE.
mvn package
build using javacmvn test
to run the testsmvn exec:exec
to run the Main applicationmvn -Pnative package
to build a native-imagemvn -Passembly package
to build an uber JAR containing all dependencies using the Maven Assembly Plugin. The resulting JAR can be executed usingjava -jar embedding-1.0-SNAPSHOT-jar-with-dependencies.jar
. We do recommend not using shading whenever possible.mvn -Pshade package
to build an uber JAR containing all dependencies using the Maven Shade Plugin. The resulting JAR can be executed usingjava -jar embedding-1.0-SNAPSHOT.jar
. We do recommend not using shading whenever possible.
Please see the pom.xml file for further details on the configuration.
Download Gradle or import as Maven project into your IDE.
gradle build
build using javacgradle run
to run the Main applicationgradle test
to run the testsgradle nativeCompile
to build a native-imagegradle nativeRun
to run the native image
Please see the build.gradle.kts file for further details on the configuration.