Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src
.gitignore Add spring-r demo, initial commit May 4, 2018
README.md
pom.xml

README.md

GraalVM demos: Spring Boot using R packages demo

This repository contains the code for a demo application for GraalVM.

Prerequisites

Preparation

Download or clone the repository and navigate into the spring-r directory:

git clone https://github.com/graalvm/graalvm-demos
cd graalvm-demos/spring-r

This is a simple Java Spring application that uses GraalVM interop to load an R script, which uses typical R packages, ggplot2 in this case.

Before running this example, you need to build the application. Make sure you export $GRAALVM_HOME, add $GRAALVM_HOME/bin to the $PATH. Set JAVA_HOME=$GRAALVM_HOME to be able to add graal-sdk.jar to the classpath.

Install R support for GraalVM:

gu install R

Install R dependencies. The following command will download the sources for the ggplot2 dependencies, and place them into GraalVM distribution. (Note: it can take a couple of minutes.)

Rscript -e "install.packages(\"ggplot2\")"

Run mvn spring-boot:run

When the application is ready, open http://localhost:8080/load.

You can’t perform that action at this time.