Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5985961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:36:18+00:00 2026-05-22T22:36:18+00:00

We have some proprietary libraries we need to interface with. These libraries are Windows

  • 0

We have some proprietary libraries we need to interface with. These libraries are Windows DLLs, or Linux .so files. We got the headers to define the interfaces. Since I have never done anything with native libs, I looked at JNAerator (http://code.google.com/p/jnaerator/) and the BridJ and JNA stuff.

What’s a simple way to use a C++ header file and the compiled lib to generate an interface? For example, by adopting JNA in general with something like:

SomeDLL lib = (SomeDLL) Native.loadLibrary("some_dll", SomeDLL.class);

I have to keep the DLL somewhere: how do I bundle the DLL with the Jar? I use Maven to build the Jar file… but the Native.loadLibrary interface doesn’t allow to directly specify a path.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:36:19+00:00Added an answer on May 22, 2026 at 10:36 pm

    JNI coding is usually a manual process of writing C++ code to create the native glue methods. There’s an entire book that explains it.

    In some cases, http://jna.java.net/ can automate or accelerate this process, but don’t count on it.

    You can’t ‘bundle the native libraries’ unless you go down the path of using OSGi or something like the Tanukisoft packaging tool, there’s no built-in feature for that purpose in Java.

    You connect the dots by using -Djava.library.path to tell java where to find native libraries, or using the lower-level APIs to System.loadLibrary that allow you to specify a full path.

    Watch out for interactions with PATH and LD_LIBRARY_PATH if your native libraries have dependencies in turn.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some files on our website that users of our software can download.
I'm starting with PHP for dynamic web pages. I have some libraries written in
Suppose I have some sort of proprietary web framework. Should I include a <meta
This is the situation: We have some binary files (PDFs, PPTs, ZIPz, etc.) stored
i have a input tag which is non editable, but some times i need
I'm currently porting a proprietary dll (an API) to C#, and I have some
I'm currently porting a proprietary dll (an API) to C#, and I have some
I have a need to do some fairly simple (at least on the surface)
I have some UI in VB 2005 that looks great in XP Style, but
I have some ASP.NET web services which all share a common helper class they

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.