Skip to content
No description, website, or topics provided.
JavaScript Java Go C
Branch: master
Clone or download
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.
c
go
java/org/pkg/implnative
js
.gitignore
graal-sdk
readme.md

readme.md

play with graal native shared

requirements

  • GraalVM is installed
  • set $GRAAL_HOME environment variable

compile java

.class file will be generated to .java existing directory.

$GRAAL_HOME/bin/javac java/org/pkg/implnative/NativeImpl.java

compile native shared object

.h, .so (linux) or .dylib (mac) files will be generated.

$GRAAL_HOME/bin/native-image --shared -H:Name=libnativeimpl -cp java

compile C code and link

-l option must be after .c source file name.

gcc -Wall -I ./ c/main.c -L ./ -l nativeimpl -Wl,-rpath='$ORIGIN/'

run C binary

./a.out

build golang

golang 1.11 or later is required for -Wl,-rpath option.

go build go/main.go

run golang binary

./main

run js

cd js
npm install
node index.js
You can’t perform that action at this time.