GraalVM是一个高性能的JDK发行版,旨在加速执行用Java和其他JVM语言编写的应用程序,同时支持JavaScript、Ruby、Python和其他一些流行语言。GraalVM的多语言功能使得在一个应用程序中混合多种编程语言成为可能,同时消除了外语调用成本。
GraalVM主要想解决Java在云原生应用开发困境。
Feature | Linux AMD64 | Linux ARM64 | macOS | Windows |
Native Image | stable | experimental | stable | experimental |
LLVM runtime | stable | experimental | stable | not available |
LLVM toolchain | stable | experimental | stable | not available |
JavaScript | stable | experimental | stable | experimental |
Node.js | stable | experimental | stable | experimental |
Java on Truffle | experimental | not available | experimental | experimental |
Python | experimental | not available | experimental | not available |
Ruby | experimental | not available | experimental | not available |
R | experimental | not available | experimental | not available |
WebAssembly | experimental | experimental | experimental | experimental |
下载到本地后解压到某一位置,如解压到D:graalvm-ce-java11-21.2.0
publicclassTest{publicstaticvoidmain(String[] args){ System.out.println("Hello GraalVM!"); System.out.println(args[0]); }}
要先安装native-image
主要系统要确定已经安装了visual Studio
使用带VS环境的命令行,运行native-image
生成test.exe,文件大小10M多点