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/reference-manual/embedding/embed-languages.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ beneath each code example to choose between JavaScript, R, Ruby, and Python.
31
31
Ensure you set up GraalVM before you begin.
32
32
33
33
## Compile and Run a Polyglot Application
34
-
GraalVM can run polyglot applications written in any language implemented with the [Truffle language implementation framework](/graalvm-as-a-platform/language-implementation-framework/).
34
+
GraalVM can run polyglot applications written in any language implemented with the [Truffle language implementation framework](../../graalvm-as-a-platform/truffle/README.md).
35
35
These languages are henceforth referenced as **guest languages**.
36
36
37
37
Complete the steps in this section to create a sample polyglot
Copy file name to clipboardExpand all lines: docs/reference-manual/embedding/sandbox-options.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ The following document describes how to configure sandbox resource limits using
6
6
7
7
In general all resource limit options are prefixed with `sandbox` option group and they can be listed using the help of any language launcher provided in GraalVM e.g. `js --help:tools`.
8
8
Polyglot options can be provided through the language launcher, using the polyglot embedding API of the Graal SDK, or on the JVM using a system property.
9
-
For better understanding of the examples it is recommended to read the [polyglot embedding guide](/reference-manual/embed-languages/) of the reference manual first.
9
+
For better understanding of the examples it is recommended to read the [polyglot embedding guide](embed-languages.md) of the reference manual first.
10
10
11
11
Currently all sandbox options are experimental therefore in these examples it is assumed that experimental options are enabled (e.g. with `--experimental-options`).
12
12
The options are a best effort approach to limiting resource usage of guest applications.
The main trade off for using Native Image is that the analysis and compilation of your program happens under the closed world assumption, meaning the static analysis needs to process all bytecode which will ever be executed in the application.
132
132
This makes using some language features like dynamic class loading or reflection tricky.
133
133
134
-
Java on Truffle is a JVM implementation of a JVM bytecode interpreter, built on the [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/).
134
+
Java on Truffle is a JVM implementation of a JVM bytecode interpreter, built on the [Truffle framework](../../graalvm-as-a-platform/truffle/README.md).
135
135
It is essentially a Java application, as are the Truffle framework itself and the GraalVM JIT compiler.
136
136
All three of them can be compiled ahead-of-time with `native-image`.
137
137
Using Java on Truffle for some parts of your application makes it possible to isolate the required dynamic behaviour and still use the native image on the rest of your code.
@@ -144,9 +144,9 @@ It is a REPL capable of evaluating Java code and consists of two parts:
144
144
This design naturally fits the point we are trying to illustrate. We can build a native executable of the JShell's UI part, and make it include Java on Truffle to run the code dynamically specified at run time.
Copy file name to clipboardExpand all lines: docs/reference-manual/java-on-truffle/FAQ.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ That means it can only run a Java program once it has been compiled to Java byte
14
14
In the GraalVM family, this is similar to WebAssembly or the LLVM interpreter: while both can run C programs, they have to be complied by a C compiler first.
15
15
16
16
### Does Java running on Truffle run on HotSpot too?
17
-
Like other languages implemented with the [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/), it can run both as a native image or on top of HotSpot.
17
+
Like other languages implemented with the [Truffle framework](../../graalvm-as-a-platform/truffle/README.md), it can run both as a native image or on top of HotSpot.
18
18
Running on top of HotSpot is currently only possible on Linux.
19
19
We plan to extend this capability to macOS and Windows platforms also.
With Java on Truffle you can benefit from enhanced HotSwap [capabilites](/reference-manual/java-on-truffle/demos/#enhanced-hotswap-capabilities-with-java-on-truffle) that allow the code to evolve naturally during development without the need for restarting a running application.
10
+
With Java on Truffle you can benefit from enhanced HotSwap [capabilites](Demos.md/#enhanced-hotswap-capabilities-with-java-on-truffle) that allow the code to evolve naturally during development without the need for restarting a running application.
11
11
12
12
While code reloading (HotSwap) is a powerful tool, it is not sufficient to reflect all kinds of changes, e.g., changes to annotations, framework-specific changes such as implemented services or beans.
13
13
For these things the code often needs to be executed to reload configurations or contexts before the changes are fully reflected in the running instance.
@@ -18,7 +18,7 @@ The main design principle is that you can register various HotSwap listeners tha
18
18
Examples include the ability to re-run a static initializer, a generic post HotSwap callback and hooks when implementations for a certain service provider changes.
19
19
20
20
**Note**: The HotSwap Plugin API is under development and more fine-grained registration of HotSwap listeners are likely to be added upon requests from the community.
21
-
You are welcomed to send enhancement requests to help shape the API through our community support [channels](/community/).
21
+
You are welcomed to send enhancement requests to help shape the API through our community support [channels](https://www.graalvm.org/community/).
22
22
23
23
Review the HotSwap Plugin API by going through a running example that will enable more powerful reloading support on [Micronaut](https://micronaut.io/).
24
24
@@ -138,7 +138,7 @@ Here is a sample application created from the tutorial ["Creating your first Mic
138
138
Example's sources can be downloaded as a ready-made Gradle project from [here](https://guides.micronaut.io/latest/micronaut-creating-first-graal-app-gradle-java.zip).
139
139
Download, unzip and open the project in your IDE.
140
140
141
-
Before you proceed, make sure that you have Java on Truffle [installed](/reference-manual/java-on-truffle/#install-java-on-truffle) and set the GraalVM as the project SDK.
141
+
Before you proceed, make sure that you have Java on Truffle [installed](README.md/#install-java-on-truffle) and set the GraalVM as the project SDK.
142
142
143
143
1. In your IDE navigate to the root `build.gradle` within the sample project. Add:
Copy file name to clipboardExpand all lines: docs/reference-manual/java-on-truffle/ImplementationDetails.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Java on Truffle is a minified Java VM that implements all core components of a V
21
21
* Java Debug Wire Protocol (JDWP)
22
22
23
23
Java on Truffle reuses all JARs and native libraries from GraalVM.
24
-
All native libraries and methods are loaded/accessed/called via [Truffle Native Function Interface (JNI)](https://www.graalvm.org/graalvm-as-a-platform/language-implementation-framework/NFI/).
24
+
All native libraries and methods are loaded/accessed/called via [Truffle Native Function Interface (JNI)](../../graalvm-as-a-platform/truffle/NFI.md).
25
25
JNI handles are implemented in Java on Truffle, e.g., all Truffle NFI methods only receive and return primitives.
26
26
Some methods are substituted for performance, e.g., `Math.sqrt`, `System.arraycopy`, avoiding the expensive transition to native.
27
27
@@ -33,8 +33,8 @@ This mode is not used when running in a native image since there will be no conf
33
33
34
34
* Java on Truffle does not implement the [JVM Tool Interface (JVMTI)](https://docs.oracle.com/en/java/javase/11/docs/specs/jvmti.html). As a result, it does not support the `-agentlib`, or `-agentpath` VM options.
35
35
* Java on Truffle does not implement the `java.lang.instrument` interface. As a result it does not support the `-javaagent` VM option.
36
-
* Java on Truffle currently uses the standard native libraries from the Java core library. This requires allowing a polyglot `Context` native access. Because of the way these libraries are loaded (via [Truffle NFI](https://www.graalvm.org/graalvm-as-a-platform/language-implementation-framework/NFI/)), running on top of HotSpot only works on Linux (with `glibc`). Running as part of a native image works on Linux, Windows, and macOS but it currently limited to one context.
36
+
* Java on Truffle currently uses the standard native libraries from the Java core library. This requires allowing a polyglot `Context` native access. Because of the way these libraries are loaded (via [Truffle NFI](../../graalvm-as-a-platform/truffle/NFI.md)), running on top of HotSpot only works on Linux (with `glibc`). Running as part of a native image works on Linux, Windows, and macOS but it currently limited to one context.
37
37
* Support for [Java Management Extensions (JMX)](https://docs.oracle.com/javase/tutorial/jmx/index.html) is partial and some methods might return partial data.
38
-
* The [Debugger Protocol Implementation (JDWP)](https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/jdwp-spec.html) lacks some capabilities compared to HotSpot. It will correctly report the supported [capabilities](https://docs.oracle.com/javase/8/docs/platform/jpda/jdwp/jdwp-protocol.html#JDWP_VirtualMachine_Capabilities). In particular actions that require to enumerate all Java objects are not supported. However it does support a few hot reloading cases that HotSpot does not. See [Enhanced HotSwap Capabilities with Java on Truffle](/reference-manual/java-on-truffle/demos/#enhanced-hotswap-capabilities-with-java-on-truffle).
38
+
* The [Debugger Protocol Implementation (JDWP)](https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/jdwp-spec.html) lacks some capabilities compared to HotSpot. It will correctly report the supported [capabilities](https://docs.oracle.com/javase/8/docs/platform/jpda/jdwp/jdwp-protocol.html#JDWP_VirtualMachine_Capabilities). In particular actions that require to enumerate all Java objects are not supported. However it does support a few hot reloading cases that HotSpot does not. See [Enhanced HotSwap Capabilities with Java on Truffle](Demos.md/#enhanced-hotswap-capabilities-with-java-on-truffle).
39
39
* When the `java.MultiThreaded` option is set to "false", [reference processing](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/package-summary.html) will not happen. Depending on the application, this could create resource leaks. Note that this option is set to "false" automatically if Java on Truffle runs in a context where a single-threaded language is enabled (e.g., JavaScript).
40
-
* Java on Truffle does not support the [Polyglot API](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/package-summary.html) yet. However, it provides a guest Java Polyglot API, described in `polyglot.jar`. For more information, see [Interoperability with Truffle Languages](/reference-manual/java-on-truffle/interoperability/).
40
+
* Java on Truffle does not support the [Polyglot API](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/package-summary.html) yet. However, it provides a guest Java Polyglot API, described in `polyglot.jar`. For more information, see [Interoperability with Truffle Languages](Interoperability.md).
Java on Truffle allows you to interface other "Truffle" languages (languages which interpreters are implemented with the [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/)) to create polyglot programs -- programs written in more than one language.
10
+
Java on Truffle allows you to interface other "Truffle" languages (languages which interpreters are implemented with the [Truffle framework](../../graalvm-as-a-platform/truffle/README.md)) to create polyglot programs -- programs written in more than one language.
11
11
12
12
This guide describes how to load code written in foreign languages, how to export and import objects between languages, how to use Java on Truffle objects from a foreign language, how to use foreign objects from Java on Truffle, and how to embed in host Java.
Using GraalVM, you can run Java applications normally [on the JVM](/reference-manual/java/), in [Native Image](/reference-manual/native-image/), and now on Truffle.
10
+
Using GraalVM, you can run Java applications normally [on the JVM](../java/README.md), in [Native Image](../native-image/README.md), and now on Truffle.
11
11
Java on Truffle is an implementation of the Java Virtual Machine Specification, [Java SE 8](https://docs.oracle.com/javase/specs/jvms/se8/html/index.html) and [Java SE 11](https://docs.oracle.com/javase/specs/jvms/se11/html/index.html), built upon GraalVM as a Truffle interpreter.
12
12
It is a minified Java VM that includes all core components of a VM, implements the same API as the Java Runtime Environment library (libjvm.so), and reuses all JARs and native libraries from GraalVM.
13
-
See the [Implementation Details](/reference-manual/java-on-truffle/implementation/) for more information.
13
+
See the [Implementation Details](ImplementationDetails.md) for more information.
14
14
The project name behind this implementation is "Espresso".
15
15
Its open source version is available on [GitHub](https://github.com/oracle/graal/tree/master/espresso).
16
16
17
-
The Java on Truffle execution mode runs Java via a Java bytecode interpreter, implemented with the [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/) – an open-source library for writing interpreters for programming languages.
17
+
The Java on Truffle execution mode runs Java via a Java bytecode interpreter, implemented with the [Truffle framework](../../graalvm-as-a-platform/truffle/README.md) – an open-source library for writing interpreters for programming languages.
18
18
Now Java can be executed by the same principle as other languages in the GraalVM ecosystem (JavaScript, Ruby, Python, R), directly interoperate with those languages, and pass data back and forth in the same memory space.
19
19
Besides complete language interoperability, with Java on Truffle you can:
20
20
@@ -28,8 +28,8 @@ It is available as of version 21.0.0.
28
28
29
29
## Install Java on Truffle
30
30
31
-
To run Java on Truffle, you need to have [GraalVM installed](/docs/getting-started/#install-graalvm).
32
-
The Java on Truffle runtime is not available by default, but can be easily added to GraalVM using the [GraalVM Updater tool](/reference-manual/graalvm-updater/).
31
+
To run Java on Truffle, you need to have [GraalVM installed](../../getting-started/graalvm-community/get-started-graalvm-community.md).
32
+
The Java on Truffle runtime is not available by default, but can be easily added to GraalVM using the [GraalVM Updater tool](../graalvm-updater.md).
33
33
34
34
For GraalVM Community Edition users, run the following command to install Java on Truffle from the GitHub catalog:
35
35
```shell
@@ -81,7 +81,7 @@ You can still influence the performance by passing the following options to `jav
81
81
*`--engine.MultiTier=true` to enable multi-tier compilation;
82
82
*`--engine.Inlining=false` in combination with `--java.InlineFieldAccessors=true` to make the compilation faster, in exchange for slower performance.
83
83
84
-
The `--vm.XX:` syntax ensures the option is passed to the underlying [native image VM](https://www.graalvm.org/reference-manual/native-image/HostedvsRuntimeOptions).
84
+
The `--vm.XX:` syntax ensures the option is passed to the underlying [native image VM](../native-image/HostedvsRuntimeOptions.md).
85
85
When using the `-XX:` syntax, the VM first checks if there is such an option in the Java on Truffle runtime.
86
86
If there is none, it will try to apply this option to the underlying native image VM.
87
87
This might be important for options such as `MaxDirectMemorySize` which can be set independently at both levels: `-XX:MaxDirectMemorySize=256M` controls how much native memory can be reserved by the Java program running on Truffle (the guest VM), while `--vm.XX:MaxDirectMemorySize=256M` controls how much native memory can be reserved by native image (the host VM).
@@ -167,11 +167,11 @@ It should show GraalVM as project's JRE and VM options should include `-truffle
167
167
## What to Read Next
168
168
169
169
Java on Truffle enables a seamless Java interoperability with other languages in the GraalVM ecosystem.
170
-
Check the [Interoperability with Truffle Languages guide](/reference-manual/java-on-truffle/interoperability/) to learn how to load code written in foreign languages, export and import objects between languages, how to use Java-on-Truffle objects from a foreign language and vice versa to create powerful polyglot programs.
170
+
Check the [Interoperability with Truffle Languages guide](Interoperability.md) to learn how to load code written in foreign languages, export and import objects between languages, how to use Java-on-Truffle objects from a foreign language and vice versa to create powerful polyglot programs.
171
171
172
-
To learn about the implementation approach, project's current status, and known limitations proceed to [Implementation Details](/reference-manual/java-on-truffle/implementation/).
172
+
To learn about the implementation approach, project's current status, and known limitations proceed to [Implementation Details](ImplementationDetails.md).
173
173
174
174
You can already run some large applications like the Eclipse IDE, Scala or other languages REPLs, etc. in the Java on Truffle execution mode.
175
-
We recommend having a look at the collection of [Demo Applications](/reference-manual/java-on-truffle/demos/).
175
+
We recommend having a look at the collection of [Demo Applications](Demos.md).
176
176
177
-
If you have a question, check the available [FAQs](/reference-manual/java-on-truffle/faq/), or reach us directly over the **#espresso** channel in [GraalVM Slack](https://www.graalvm.org/slack-invitation/).
177
+
If you have a question, check the available [FAQs](FAQ.md), or reach us directly over the **#espresso** channel in [GraalVM Slack](https://www.graalvm.org/slack-invitation/).
0 commit comments