https://github.com/lispyclouds/graal-example
Sample code for a Graal Native project
https://github.com/lispyclouds/graal-example
Last synced: 3 months ago
JSON representation
Sample code for a Graal Native project
- Host: GitHub
- URL: https://github.com/lispyclouds/graal-example
- Owner: lispyclouds
- License: lgpl-3.0
- Created: 2019-11-13T13:08:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-13T17:19:19.000Z (over 5 years ago)
- Last Synced: 2025-01-28T14:48:17.793Z (5 months ago)
- Language: Clojure
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# graal-example
A sample project starter compiling with GraalVM native image.
## Building and running from source
### Requirements:
- An OS supported by the JVM
- [Graal VM](https://www.graalvm.org/downloads/)### Installing GraalVM for native compilation:
- Download GraalVm CE from https://www.graalvm.org/downloads/
- Extract it to a location navigate to the directory where you can find bin, lib, jre directoires
- Set an 2 environemnt vars `GRAALVM_HOME` and `JAVA_HOME` to this directory
- Install Leiningen https://leiningen.org/
- Run `$GRAALVM_HOME/bin/gu install native-image` to install the native tooling for Graal### Editor setup:
- [Emacs](https://cider.mx/)
- [IntelliJ](https://cursive-ide.com/) (Get a free license by choosing Non-Commercial License)
- [Vim](https://github.com/tpope/vim-fireplace)
- [VSCode](https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva)
- [Atom](https://atom.io/packages/chlorine)### Test if setup is fine:
- Make sure all of the Graal installation steps went fine
- Clone this repo
- Run "lein native-image"
- *Lots of minutes later...* you should have a file in: `/target/default+uberjar/graal-example`.
- Running `./target/default+uberjar/graal-example` should produce:
```json
{
"name" : "Amazon.com Inc",
"price" : 1778
}
```