jna-utils-parent

The base parent for all open-source projects coming from mhoffrogge.

License

License

Categories

Categories

JNA Development Tools Native
GroupId

GroupId

de.mhoffrogge.jna
ArtifactId

ArtifactId

jna-utils-parent
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

pom
Description

Description

jna-utils-parent
The base parent for all open-source projects coming from mhoffrogge.
Project Organization

Project Organization

mhoffrogge
Source Code Management

Source Code Management

https://github.com/mhoffrog/jna-utils

Download jna-utils-parent

How to add to project

<!-- https://jarcasting.com/artifacts/de.mhoffrogge.jna/jna-utils-parent/ -->
<dependency>
    <groupId>de.mhoffrogge.jna</groupId>
    <artifactId>jna-utils-parent</artifactId>
    <version>0.1.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/de.mhoffrogge.jna/jna-utils-parent/
implementation 'de.mhoffrogge.jna:jna-utils-parent:0.1.0'
// https://jarcasting.com/artifacts/de.mhoffrogge.jna/jna-utils-parent/
implementation ("de.mhoffrogge.jna:jna-utils-parent:0.1.0")
'de.mhoffrogge.jna:jna-utils-parent:pom:0.1.0'
<dependency org="de.mhoffrogge.jna" name="jna-utils-parent" rev="0.1.0">
  <artifact name="jna-utils-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='de.mhoffrogge.jna', module='jna-utils-parent', version='0.1.0')
)
libraryDependencies += "de.mhoffrogge.jna" % "jna-utils-parent" % "0.1.0"
[de.mhoffrogge.jna/jna-utils-parent "0.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • jna-utils

jna-utils

Utility package for Java JNA

Purpose

This module provides methods to extract native dynamic library files bundled in a JAR on the classpath to any folder on the runtime filesystem.
A single JAR can contain dynamic libraries for multiple platforms.
This utility module will load the appropriate library based on the actual platform at runtime.

Maven

<dependency>
  <groupId>de.mhoffrogge.jna</groupId>
  <artifactId>jna-utils</artifactId>
  <version>0.1.0</version>
</dependency>

Features

  • A single JAR can contain native dynamic libraries for multiple platforms.
  • The target directory of the unpacked dynamic libraries will be prepended to the environment settings of java.library.path as well as to the OS PATH (Windows) or LD_LIBRARY_PATH (Linux) variable.
  • If the native dynamic librar(y|ies) ecplicitely loaded by your application depend on other dynamic libraries not being loaded explicitley, then those dependent libraries can be bundled as well and they will be found by the OS loader due to the previously mentioned environment variable updates
  • All dynamic libraries found in folder /<com.sun.jna.Platform.RESOURCE_PREFIX> will be extracted

Conventions

  • The bundled dynamic libraries must be located in folder /<com.sun.jna.Platform.RESOURCE_PREFIX> inside the JAR:
 /
 ├──win32-x86
 │   ├──foo_jna_loaded.dll
 │   └──foo_required.dll
 │
 └──win32-x86-64
     ├──foo_jna_loaded.dll
     └──foo_required.dll
  • The JAR to be used for extracting native dynamic libraries is determined on the classpath by passing a JARs class to the appropriate jna-utils API method.
  • If there are multiple JARs on the classpath containing the same reference class, only the first JAR found on the classpath will be used for looking up the native libraries

Limitations

  • Currently only Windows and Linux platforms supported
  • Linux not yet tested

License

This project is licensed under Apache License, Version 2.0.

Versions

Version
0.1.0