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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:31:04+00:00 2026-06-06T07:31:04+00:00

I have a .dll library which exports a function in the following format: _Java_folder1_folder2_folder3_JavaClassName_javamethodname@16

  • 0

I have a .dll library which exports a function in the following format:

_Java_folder1_folder2_folder3_JavaClassName_javamethodname@16

I cannot modify the .dll. It was given to me.

I need to write a java program to call the native javamethodname. However, I have trouble generating the right header file. How can I generate a header file with the signature specified above?

I tried javah -jni JavaClassName, but it does not give me the desired result. When I call javah from inside the directory hierarchy, I get a header like:

Java_JavaClassName_javamethodname

When I try to call javah from outside the directory hierarchy, I get an error.

Also, how do I get the underscore in the header signature in front of Java? That is: _Java not Java.

Thanks!

  • 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-06T07:31:06+00:00Added an answer on June 6, 2026 at 7:31 am

    Writing the java code is easy: you create a Java project with package name folder1.folder2.folder3 and put your class JavaClassName in there with a native javamethodname. You don’t need to generate headers or anything, that has been already done by someone who created the DLL and had the same class as you are reconstructing.

    The Java_ prefix is standard and is added by the JVM-JNI linker, you don’t need to care about it.

    However, i read between the lines that you have also a problem with the leading underscore. It is a “compiler decoration” and if you got only the DLL (no sources, no recompilation), you might be as well doomed. Various compilers add various “decorations” to ensure that you don’t mix up calling convention between the caller (JVM) and callee (DLL). It has some observable default behavior and can be mangled by various compiler options and/or definition files (.def on MSVC). Neither of this is applicable for your case. So you need:

    1. Find out what compiler was used to produce the DLL
    2. Look up the calling convention for which the given compiler produces your observed symbol decoration
    3. Your DLL is runnable only through JVM which has the same calling convention defined as JNICALL macro in $JAVA_HOME/include/your_platform/jni_md.h
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider i have an assembly(class library dll) which i have loaded using the following
I have a DLL file library.dll which contains a function foo . The function
I have a shared library which is supposed to export only one function which
I have a VC++ dll library which is built (with Visual Studio 2003) on
In my work we have an outside bin library which has many many dll's.
I have a dll which exports the interface class Qwe{ virtual void a() =
I have implemented software which have a DLL library which contains a set of
I have the following requirement. I need to implement dll kind of thing on
I have a DLL library, but I am not familiar with it. How can
I have written a C# class library (DLL) and wondering the quickest way to

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.