Thanks Rob Spoor,
I put path in system properties --> Advanced--> environment Variables--> system Variables-->path-->
same time i put
system properties --> Advanced--> environment Variables--> system Variables-->include-->
I try to run simple java file from cmd & from directory where it put...it also run properly...means jdk also work properly.
I also download code blocks 10.05 for compile & run c files
Today first i try to run basic helloworld.c from cmd... which explain in all c books...
i run command in cmd from directory where i put that c file as g++ helloworld.c
it create a.exe
when i run it console shows "hello world"
But when i build this helloworld.c from code blocks IDE it create helloworld.exe & helloworld.c
means in my pc compiler work perfectly...
now when i try to build jniExample which i download from webpage.
I got error
Now i confuse again...Currently
i can run only java file == yes
i can run only c files == yes
i can run java file which calls c file == no
You need to tell gcc that it needs to create a shared library. If you don't it will look for either a WinMain or main function. I think adding -shared to your compiler flags is enough but I'm not sure.
I have a similar requirement for my application. I have to call kenen API (third party billing tool written in C) through java application, i have .SO file of kenen. I have created C file for JNI call though java.But i am not able to call kenan API methods those are precompiled in my .SO files.
Please suggest me on calling API methods from my JNI C function.
Any help will be beneficial to me.
Thanks in advance.
subject: Learning JNI for java,c,cpp combined programming