GraalVM: Difference between revisions
Jump to navigation
Jump to search
Line 66: | Line 66: | ||
* [https://developer.okta.com/blog/2019/11/27/graalvm-java-binaries GraalVM Mix JavaScript and Java] | * [https://developer.okta.com/blog/2019/11/27/graalvm-java-binaries GraalVM Mix JavaScript and Java] | ||
* [https://medium.com/graalvm/3-ways-to-polyglot-with-graalvm-fb28c1542b45 GraalVM Polyglot Programming] | * [https://medium.com/graalvm/3-ways-to-polyglot-with-graalvm-fb28c1542b45 GraalVM Polyglot Programming] | ||
* [[Debian/GraalVM]] | * [[Debian/GraalVM]] | ||
* [[Fedora/GraalVM]] | * [[Fedora/GraalVM]] | ||
* [[Ubuntu/GraalVM]] | * [[Ubuntu/GraalVM]] | ||
* [[MacOS/GraalVM]] | |||
| valign="top" | | | valign="top" | | ||
Line 79: | Line 80: | ||
* [https://www.graalvm.org/22.0/reference-manual/js/JavaScriptCompatibility/ GraalVM: JavaScript Compatibility] | * [https://www.graalvm.org/22.0/reference-manual/js/JavaScriptCompatibility/ GraalVM: JavaScript Compatibility] | ||
* [https://zeringue.io/post/graalvm-gradle-docker/ Build Slim Java Native Container] | * [https://zeringue.io/post/graalvm-gradle-docker/ Build Slim Java Native Container] | ||
* [https://medium.com/@john_freeman/native-javac-with-graalvm-ddcc18a53edb Native javac built with GraalVM] | |||
* [https://www.graalvm.org/docs/getting-started/macos/ GraalVM on macOS Platforms] | * [https://www.graalvm.org/docs/getting-started/macos/ GraalVM on macOS Platforms] | ||
Revision as of 08:18, 11 March 2022
export GRAALVM_HOME=/d/opt/cli/mandrel-java11-21.2.0.0-Final
export PATH=$GRAALVM_HOME/bin:$PATH
OR export GRAALVM_HOME=/d/opt/cli/graalvm-ce-java11-21.2.0
export PATH=$GRAALVM_HOME/bin:$PATH
gu install native-image
|
set GRAALVM_HOME=D:\opt\cli\mandrel-java11-21.2.0.0-Final
set PATH=%GRAALVM_HOME%/bin;%PATH%
OR set GRAALVM_HOME=D:\opt\cli\graalvm-ce-java11-21.2.0
set PATH=%GRAALVM_HOME%/bin;%PATH%
gu install native-image
|
# for oracle linux, debian, redhat
sudo yum install gcc glibc-devel zlib-devel
sudo apt install build-essential libz-dev zlib1g-dev
sudo dnf install gcc glibc-devel zlib-devel libstdc++-static
# to use xcode in macos
xcode-select --install
|
To build a native image as a shared library of a Java class file, pass --shared
to the native image builder. The created shared library will have the main method of the given Java class as its entrypoint method.
native-image class [libraryname] --shared
To build a native image as a shared library of a JAR file, use:
native-image -jar jarfile [libraryname] --shared
Note: if you build a shared library where you do not specify a main class, you must append the -H:Name=
flag to specify the library name: -H:Name=libraryname
.