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

  • SEARCH
  • Home
  • 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 7719303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:22:57+00:00 2026-06-01T03:22:57+00:00

I have a Java application which interacts with native code using JNI. The native

  • 0

I have a Java application which interacts with native code using JNI. The native code compiles a file at runtime and attempts to load this file using a dlopen call. This call fails and I get a warning stating

Could not load library (x):(x) undefined symbol: y

However when I have a native application starting a JVM via JNI run the same code, this error does not occur and it runs as expected. I am suspecting Java is doing something fancy which causes the already loaded libraries to be invisible for the library that is loaded with dlopen.

This I did to diagnose the problem:

  • Confirmed in which shared library the symbol that was supposedly undefined is located using objdump
  • Confirmed this library is loaded by using gdb (via eclipse – the library was listed in the modules pane)
  • Printed LD_LIBRARY_PATH just before the dlopen and confirmed Java passes it through (It did add Java’s lib dirs but the original dirs were still there)

I have been trying to solve this for a while now, but I can’t figure out what is going on. Especially because it does work when the JVM is loaded from a native application.

Thank you in advance!

  • 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-06-01T03:22:58+00:00Added an answer on June 1, 2026 at 3:22 am

    I finally found the answer. The solution was to recompile the shared library that contained the symbol that was not found with the -Wl,--export-dynamic linker flag.

    Interestingly I did not program that shared library myself and I would expect the default compilation to add the flag since it was needed for software using it to function properly.

    Either way it is a open source project so I could compile it with the proper flags set.

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

Sidebar

Related Questions

I have a Java application which is using a certain Java Runtime Environment. The
I have web services written using java which interacts with the android application only
I have Java application which sends pointer to function (callback) to some native dll
I have a Java Application which has to load an DLL with a few
I have Java application which adds JTextFields @ runtime to JPanel. Basically user clicks
I have a DOS batch script that invokes a java application which interacts with
I have a Java application in which user can give any executable file (.exe)
I have developed a java application which takes a screenshot using robot (presses Print
I have a Java application which I want to shutdown 'nicely' when the user
I have a Java application which requires certain software (one of them being Perl)

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.