Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: DLL FILES

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DLL FILES

    Dear Dudes,
    I want to open the DLL files. i need the solution


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: DLL FILES

    Moved to the JNI section.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: DLL FILES

    Quote Originally Posted by rubiya View Post
    I want to open the DLL files. i need the solution
    Do you want to invoke functions in a DLL? Ok but keep in mind that JNI (Java Native Interface) is a technology to invoke functions in native shared libraries ("DLL" or whatever is in another O.S.) but these libraries must be developed expressely for JNI because they must comply with a lot of conventions of JNI. In other words, JNI is not able to access any shared library!

    There is a project called JNA (https://github.com/twall/jna), I don't know if it's still alive/valid or not, I have tried it years ago. JNA can access any shared library because JNA is a "bridge" between Java and the native library, using JNI under the hood. Using JNA you don't need to know about JNI, but you still need to know which are the native functions to invoke, what they receive/return, what types, etc... because you have to "map" these things in a Java interface.

    Please, clarify which shared library you want to use, which O.S. (I deduce Windows), which functions.
    And also which is your knowledge about Java and native functions developed in C/C++ (use of JNI/JNA is an advanced concept, not for newbies).
    Andrea, www.andbin.netSCJP 5 (91%) – SCWCD 5 (94%)

    Useful links for Java beginnersMy new project Java Examples on Google Code

  4. #4

    Default Re: DLL FILES

    To call a function in a native library you have to declare a method in your java class as native with the java keyword native. The declaration of this method must not have a body.

    The name of the function exported from your DLL must match the following pattern: Java_classname_methodname where classname is the name of the class where you declared the native method methodname.

Similar Threads

  1. How to cal a dll?
    By TheEnd in forum Java Native Interface
    Replies: 3
    Last Post: April 6th, 2013, 11:19 PM
  2. How to Integrating c#dll with java
    By Indhu Mohan in forum Java Native Interface
    Replies: 0
    Last Post: October 4th, 2011, 11:17 PM
  3. Using DLL in Java
    By smh_5800 in forum Java Native Interface
    Replies: 3
    Last Post: February 4th, 2011, 01:01 AM
  4. Using of LabView dll in an ImageJ PlugIn
    By _LBS_ in forum Java Native Interface
    Replies: 0
    Last Post: April 14th, 2010, 03:40 AM
  5. Dll injection Java
    By TheEnd in forum Java Theory & Questions
    Replies: 1
    Last Post: March 2nd, 2010, 04:35 PM