Friday, February 25, 2011

Java Native methods

The Java native method is a great way to gain and merge the power of C or C++ programming into Java. To use Java as a scientific and high performance language, when efficient native Java compilers are not fully implemented, use native method can boost the performance to at least the speed of C compiled code.

1. Write the Java Code (Native Methods)

2. Compile the java code

Use the Java compiler to compile the Java class that you created in the previous step. At this time, you should also compile the main Java application that you wrote to test the native method.

3. Create the .h File

4. Create a Stubs File

5. Write the C Function

6: Create a Dynamically Loadable Library (Native Methods)

7. Run your application

 refer java docs for diagram and details.

No comments:

Post a Comment

Chitika