scijava/native-lib-loader
소개
Native library loader for extracting and loading native libraries from Java.
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAbout native library loader
The native library loader is a utility that assists with loading native libraries from Java. It provides the ability to painlessly identify, extract and load the correct platform-specific native library from a JAR file.
License
Simplified BSD License
Usage
Add dependency
Search Maven Central for latest version and add a dependency to your pom.xml.
<dependency>
<groupId>org.scijava</groupId>
<artifactId>native-lib-loader</artifactId>
<version>x.y.z</version>
</dependency>
Package native libraries
Native libraries should be packaged into a single jar file, with the following directory & file structure:
/natives
/linux_32
libxxx[-vvv].so
/linux_64
libxxx[-vvv].so
/osx_32
libxxx[-vvv].dylib
/osx_64
libxxx[-vvv].dylib
/osx_arm64
libxxx[-vvv].dylib
/windows_32
xxx[-vvv].dll
/windows_64
xxx[-vvv].dll
/windows_arm64
xxx[-vvv].dll
/aix_32
libxxx[-vvv].so
libxxx[-vvv].a
/aix_64
libxxx[-vvv].so
libxxx[-vvv].a
Here "xxx" is the name of the native library and "-vvv" is an optional version number. Depending on the platform at runtime, a native library will be unpacked into a temporary file and will be loaded from there.
The version information will be grabbed from the MANIFEST.mf file from "Implementation-Version" entry. So it's recommended to follow Java's package version information convention.
Load library
If you want to load 'awesome.dll' (on Windows) or 'libawesome.so' (on Linux or AIX), simply do like this ...
NativeLoader.loadLibrary("awesome");
관련 프로젝트 살펴보기
불러오는 중…