Posts

Showing posts from 2013

Easy to code Java with C/C++

Image
Easy to code Java with C/C++ Generate file header for class in Java (use to include in C/C++) Include file header in project C/C++ in Visual studio and write code => create .DLL file Call .DLL file in Java code 1.  Generate file header for class in Java (I using Netbeans) Write class in java with some "native" methods. Class MyNative with two methods Sum and Sub Open cmd and redirect to source folder ..projectname/src run: javah javaandccplus.MyNative After run it, we have a file header javaandccplus_MyNative.h with code  /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class javaandccplus_MyNative */ #ifndef _Included_javaandccplus_MyNative #define _Included_javaandccplus_MyNative #ifdef __cplusplus extern "C" { #endif /*  * Class:     javaandccplus_MyNative  * Method:    Sum  * Signature: (II)I  */ JNIEXPORT jint JNICALL Java_ja...