BYO: GraalVM Setup - Hello World
Senior Backend Engineer
Search for a command to run...
Senior Backend Engineer
No comments yet. Be the first to comment.
Install Redis cli $ brew install redis-cli General PING # Test connection, returns PONG AUTH <password> # Authenticate with password SELECT <db> # Switch to a specific database (default is 0) DBSIZE # Get total nu...

InfluxDB 3 client: influxctl influxctl is the official command-line tool for managing and interacting with InfluxDB 3 clusters. Think of it as your Swiss Army knife for database setup, bucket management, and query execution. This cheatsheet gives you...
Here is an extended and fully annotated version of the Linux Cheatsheet blog in Markdown, with: Brief descriptions for each command An Advanced Topics section covering cron, systemd, firewalld, SELinux, and more Linux Cheat sheet System Informat...

1 Year on LeetCode: Lessons, Struggles, and Growth Exactly one year ago, I made a commitment — to open LeetCode daily, without excuses, and start solving problems that once made me uncomfortable. What started as a casual attempt to improve my DSA ski...

Git Cheatsheet – The Ultimate Guide Whether you're just getting started with Git or you're a seasoned developer, having a handy cheatsheet saves time and avoids Googling the same commands over and over again. This guide is organized into Basic, Inter...

In this blog, we will setup local development environment for native Java using Graal VM. For this we will use following tools
Ubuntu 24.04
Sdkman
GraalVM 21
Maven
Code used in this blog: link
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble
$ curl -s "https://get.sdkman.io" | bash
Output:
All done!
You are subscribed to the STABLE channel.
Please open a new terminal, or run the following in the existing one:
source "/home/arpit/.sdkman/bin/sdkman-init.sh"
Then issue the following command:
sdk help
Enjoy!!!
# Open a new terminal (Otherwise the command `sdk` will not be available)
# Install prerequisites for GraalVM
$ sudo apt-get install -y build-essential zlib1g-dev
# List available java versions
$ sdk list java
================================================================================
Available Java Versions for Linux ARM 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
Corretto | | 23.0.1 | amzn | | 23.0.1-amzn
| | 21.0.5 | amzn | | 21.0.5-amzn
| | 17.0.13 | amzn | | 17.0.13-amzn
| | 11.0.25 | amzn | | 11.0.25-amzn
| | 8.0.432 | amzn | | 8.0.432-amzn
GraalVM CE | | 23.0.1 | graalce | | 23.0.1-graalce
| | 21.0.2 | graalce | | 21.0.2-graalce
| | 17.0.9 | graalce | | 17.0.9-graalce
# Install GraalVM 21
$ sdk install java 21.0.2-graalce
Output
.
.
Installing: java 21.0.2-graalce
Done installing!
Setting java 21.0.2-graalce as default.
$ sdk install maven
# Clone the base project
$ git clone https://github.com/arpitrathore/build-your-own
$ cd build-your-own/01-hello-world/
# Build the `ar-helloworld` native binary using maven and GraalVM Plugin
$ mvn clean package -Pnative
Output
Produced artifacts:
/home/arpit/build-your-own/01-hello-world/target/ar-helloworld (executable)
========================================================================================================================
Finished generating 'ar-helloworld' in 56.2s.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:00 min
[INFO] Finished at: 2025-01-05T00:11:36+05:30
[INFO] ------------------------------------------------------------------------
$ ./target/ar-helloworld 130 main130 main
Hello World! Current time is: 2025-01-05T00:12:52.436238