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: espresso-shared/src/com.oracle.truffle.espresso.classfile/src/com/oracle/truffle/espresso/classfile/JavaVersion.java
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,10 @@ public boolean java23OrEarlier() {
199
199
returnversion <= 23;
200
200
}
201
201
202
+
publicbooleanjava23OrLater() {
203
+
returnversion >= 23;
204
+
}
205
+
202
206
publicbooleanjava24OrEarlier() {
203
207
returnversion <= 24;
204
208
}
@@ -227,6 +231,10 @@ public int classFileVersion() {
You can now depend on the jars using a version like `24.2.1-SNAPSHOT`.
86
86
87
+
For embedding, there is a jar containing all the necessary JDK resources (classes, libraries, config files, etc.).
88
+
This jar is made available to espresso through the truffle [resource API](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/TruffleLanguage.Env.html#getInternalResource(java.lang.String)).
89
+
It is the mx distribution called `ESPRESSO_RUNTIME_RESOURCES` and is published on maven as `org.graalvm.espresso:espresso-runtime-resources-$RuntimeResourceId` where `$RuntimeResourceId` identifies the type and version of the included JDK.
90
+
For example `org.graalvm.espresso:espresso-runtime-resources-jdk21` contain Oracle JDK 21.
91
+
`ESPRESSO_RUNTIME_RESOURCES` contains the JDK specified through `ESPRESSO_JAVA_HOME` as well as the optional llvm bits specified in `ESPRESSO_LLVM_JAVA_HOME`.
92
+
93
+
Since we might want to distribute these resources for multiple JDK version, it is possible to produce additional runtime resource jars.
94
+
This is done by setting `EXTRA_ESPRESSO_JAVA_HOMES` and optionally `EXTRA_ESPRESSO_LLVM_JAVA_HOMES`.
95
+
Those are lists of java homes separated by a path separator.
96
+
If `EXTRA_ESPRESSO_LLVM_JAVA_HOMES` is specified it should contain the same number of entries and in the same order as `EXTRA_ESPRESSO_JAVA_HOMES`.
97
+
The JDKs set in `ESPRESSO_JAVA_HOME` and `EXTRA_ESPRESSO_JAVA_HOMES` should all have different versions.
98
+
99
+
For example to produce jdk21 and jk25 resource in addition to the version of `ESPRESSO_JAVA_HOME`:
The `org.graalvm.espresso:java` maven dependency automatically depends on the "main" runtime resource (the one from `ESPRESSO_JAVA_HOME`).
112
+
In order to use a different version in an embedding, an explicit dependency to `org.graalvm.espresso:espresso-runtime-resources-$RuntimeResourceId` should be added.
113
+
The context should also be created with `java.RuntimeResourceId` set to the desired version (e.g., `"jdk21"`).
114
+
87
115
## `mx espresso-embedded ...`
88
116
89
117
To run Espresso on a vanilla JDK and/or not within a standalone use `mx espresso-embedded ...`, it mimics the `java` command. The launcher adds all jars and properties required to run Espresso on any vanilla JDK.
raisemx.abort("Each entry in EXTRA_ESPRESSO_JAVA_HOMES should have a different java version, and they should all be different from ESPRESSO_JAVA_HOME's version")
0 commit comments