GraalVM development container for Visual Studio Code. Java, R, Python, Node, Ruby, WASM included.
Follow these steps to open this sample in a container:
-
If this is your first time using a development container, please follow the getting started steps.
-
To use this repository, you can either open the repository in an isolated Docker volume:
- Press F1 and select the Remote-Containers: Open Repository in Container command
- Then type:
yarncraft/vscode-remote-graalvm
- Choose the volume of preference
- Wait for the container to start, and try things out!
Or open a locally cloned copy of the code:
- Clone this repository to your local filesystem.
- Press F1 and select the Remote-Containers: Open Folder in Container... command.
- Select the cloned copy of this folder, wait for the container to start, and try things out!
Once you have this sample opened in a container, you'll be able to work with it like you would locally.
Note: This container runs as a root user by default.
Some things to try:
- Java:
- Open
src/HelloWorld.java
. - You can press the
run-code
button to run the file - Or, you can open a terminal and write
javac src/HelloWorld.java && java HelloWorld
- Try adding some code and check out the language features.
- Open
- Java Native:
- By default, GraalVM Native is installed
- Open the src folder:
cd src
- Compile to Java Bytecode
javac HelloWorld.java
- Compile the Bytecode to a Native Image:
native-image HelloWorld
- Run the Native Image:
./HelloWorld
- R
- Execute the R script with
Rscript src/index.R
.
- Execute the R script with
- Node
- Execute the NodeJS script with
node src/index.js
. - Open up the browser and visit the website at
127.0.0.1:3000
- Execute the NodeJS script with
- Ruby
- Execute the Ruby script with
ruby src/index.rb
.
- Execute the Ruby script with
- Python
- Execute the Python script with
python src/index.py
.
- Execute the Python script with
Feel free to tweak the devcontainer.json
file by adding your own ExtensionId's to the list.
{
"name": "GraalVM",
"dockerFile": "Dockerfile",
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"forwardPorts": [3000],
"extensions": [
"vscjava.vscode-java-pack",
"dbaeumer.vscode-eslint",
"ms-python.python",
"rebornix.ruby",
"ikuyadeu.r"
]
}
Don't forget to star and follow to receive updates of new content.