-
The header file
HelloWorld.h
was generated by runningjavac -h . HelloWorld.java
. Since this is checked into the repo, it doesn't need to be run again.The dependency
org.graalvm.nativeimage/svm
has been added to the project. In this repo's case, the jar was unzipped into the classpath. If you're using a package manager or build system, follow their respective instructions to add a dependency. -
javac -cp . HelloWorld.java NativeFeature.java
-
jar cfm HelloWorld.jar manifest.txt HelloWorld.class NativeFeature.class
-
- Linux:
cc -c -I "$JAVA_HOME/include" -I "$JAVA_HOME/include/linux" -o native.o Native.c
- MacOS:
cc -c -I "$JAVA_HOME/include" -I "$JAVA_HOME/include/darwin" -o native.o Native.c
- Windows (msvc):
cl /I "%JAVA_HOME%\include" /I "%JAVA_HOME%\include\win32" /c Native.c
- Linux:
-
- Linux and MacOS:
ar rcs libNative.a native.o
- Windows (msvc):
lib Native.obj
- Linux and MacOS:
-
native-image -jar HelloWorld.jar -H:CLibraryPath=.
-
Notifications
You must be signed in to change notification settings - Fork 2
smasher164/staticjni
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Statically link JNI library with native-image
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published