-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade Java+Javascript Embedding Example to GraalVM for JDK 21 (23.1.1)
- Loading branch information
Showing
5 changed files
with
139 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,44 @@ | ||
# GraalVM Java to JavaScript Polyglot Debugging | ||
# Debugging a Java with JavaScript Embedding Application | ||
|
||
This sample code helps to demonstrate simplicity of debugging and developing GraalVM Polyglot applications using __VS Code extensions__. | ||
This sample code helps to demonstrate simplicity of debugging and developing GraalVM polyglot applications using Visual Studio (VS) Code extensions. | ||
|
||
## Prerequisites | ||
|
||
1. VS Code has to be installed. | ||
1. Install VS Code and launch it. | ||
2. Then go to VS Code Extensions activity panel and search for _GraalVM Extension Pack_, install it. The GraalVM Extension Pack will install all required extensions. | ||
3. [Install GraalVM in VS Code](https://www.graalvm.org/latest/tools/vscode/graalvm-extension/#graalvm-installation-wizard): Navigate to Gr activity panel in VS Code and install some of the latest GraalVM __Enterprise Edition__ versions available from the list. | ||
2. Open Visual Studio Code, navigate to Extensions activity panel in the left-hand side Activity Bar. Search for “GraalVM” in the search field. Find [GraalVM Tools for Java](https://marketplace.visualstudio.com/items?itemName=oracle-labs-graalvm.graalvm), press Install. Reload will be required. | ||
3. [Install GraalVM in VS Code](https://www.graalvm.org/latest/tools/vscode/graalvm-extension/#graalvm-installation-wizard): Navigate to Gr activity panel in VS Code and install the latest Oracle GraalVM version available from the list. | ||
4. Confirm to set this as _Active GraalVM_ for VS Code. | ||
5. Install the `js` component. | ||
|
||
## Debugging the project | ||
|
||
Working with Polyglot project in VSCode is simple just open this sample. | ||
## Build and Run the Application | ||
|
||
1. Open VS Code Terminal. | ||
2. Clone the repository and navigate into the `polyglot-debug` directory: | ||
```bash | ||
git clone https://github.com/graalvm/graalvm-demos | ||
``` | ||
```bash | ||
cd graalvm-demos/polyglot-debug | ||
``` | ||
|
||
3. Build the application using Maven: | ||
```bash | ||
mvn clean package | ||
``` | ||
4. Run this application with the following command: | ||
```bash | ||
mvn exec:exec | ||
``` | ||
|
||
## Debug the Application | ||
|
||
Working with a polyglot project in VS Code is simple just open this sample. | ||
It will be working out of the box with VS Code GraalVM extensions. | ||
|
||
Place breakpoints either in Java or JavaScript code. | ||
1. Place breakpoints either in Java or JavaScript code. | ||
|
||
2. To debug the project, go to __Run and Debug__ activity or simply press F5. | ||
|
||
To debug the project go to __Run and Debug__ activity or simply press F5. | ||
Choose **Launch Java 8+** as this is the Polyglot debugger provided by GraalVM extensions. | ||
3. Choose **Launch Java 8+** as this is the Polyglot debugger provided by the GraalVM extension. | ||
|
||
That is, the sample is running under debugger on GraalVM. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module demo { | ||
exports org.graalvm.demos; | ||
requires org.graalvm.polyglot; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters