Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

view native code from Eclipse

I have a java application which makes use of native method calls.Is there a way to view this code in eclipse? I can get the source code for this native library, but do not know how to link in the IDE. It will also be helpful if someone tells me how to debug this native method.

like image 638
Ravisha Avatar asked Jan 29 '10 14:01

Ravisha


1 Answers

Not a full answer, but Eclipse does have C/C++ IDE functionality

Here is some information (though it seems a bit dated): Information on CDT/JDT integration

Info on creating JNI code from inside Eclipse (look at the very last post)

It does seem like an integrated debugging experience would be well within Eclipse's capabilities, but it's obviously not hyper important.

OK - all that said, I do have a recollection of getting Visual C++ debugger to work with a Java application that was making JNI calls... It's been awhile, but I'm pretty sure you can connect the C++ debugger to the running Java application using the pid. Then set a breakpoint, and rock and roll (you'll obviously have to compile the JNI library as a debug module).

It wasn't a fully integrated experience, but it was pretty effective. I try to write my JNI code as thin wrappers around the native calls, though, so I spend very little time debugging my JNI calls.

like image 199
Kevin Day Avatar answered Oct 13 '22 20:10

Kevin Day