on 06-23-2005 1:31 AM
Hi, All!
Can I invoke functions from DLL (C++ functions) in Java classes? I have to call the function in the class related in a portal archive (PAR file).
Thanks in advance,
Swapna.
Writing native methods for Java programs is a multi-step process.
Begin by writing the Java program. Create a Java class that declares the native method; this class contains the declaration or signature for the native method. It also includes a main method which calls the native method.
Compile the Java class that declares the native method and the main method.
Generate a header file for the native method using javah with the native interface flag -jni. Once you've generated the header file you have the formal signature for your native method.
Write the implementation of the native method in the programming language of your choice, such as C or C++.
Compile the header and implementation files into a shared library file.
Run the Java program.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.