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 1106911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:51:41+00:00 2026-05-17T01:51:41+00:00

I am using Java to develop an application and I have a library that

  • 0

I am using Java to develop an application and I have a library that I need to be able to use. The library has a jar file and a dll file. At the moment I have placed the dll file into my system folder and linked the jar with the IDE. My question is, I want to package everything into a single executable jar in which the user can run (perhaps using webstart).

How can generate this jar file without having the user copy the dll inside the system folder? Is there a way I can put everything in a single archive?

  • 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-17T01:51:41+00:00Added an answer on May 17, 2026 at 1:51 am

    You can package the .dll into the .jar, but the physical .dll file must be unpackaged from there before it can be loaded because of how Windows handles .dlls. There’s no way to load a .dll directly from inside the .jar.

    This question seems to contain an appropriate implementation. Note, though, that it’s somewhat error-prone: if the program hasn’t write permissions to wherever it’s going to extract the .dll,you’re in a bizarre situation; you can’t load the .dll because you don’t have permissions to write it first.

    A more robust solution is to use some kind of installer to install the whole application into a directory hierarchy such as

    /whatEver/myApp/                 (The working directory of the app.)
    /whatEver/myApp/myApp.jar        (The main app.)
    /whatEver/myApp/lib/library.dll  (The JNI library.)
    

    Then you can load the dll simply using a path relative to the working directory,

    System.loadLibrary("lib/library.dll");
    

    To be even more robust, you’ll want to ensure that you’re running a JVM with appropriate amount of bits before attempting to load the library. A little-advertised fact is that a 64-bit VM can’t load 32-bit libraries, nor vice versa. See this question.

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

Sidebar

Related Questions

I need to develop the HTTPS application using Flex and Java. But i have
I have been trying to develop a Java ME application using WTK 2.5.2 (Java
I need to develop an application that connects to various DSN's using the Microsoft
I am using Java to develop an application, it needs to manage the file
Am using java to develop program that receives and processes SMS messages. I have
We recently started using Eclipse to develop our java application and have been running
I have to develop a desktop application using Java. I've some experience with Java
I am using Eclipse to develop a Blackberry Java application.Is possible to automatically increment
I am using Jersey/Java to develop my REST services. I need to return an
I have been tasked to develop an interactive website using java & mysql: using

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.