2

I have a C++ application that uses the Java Native Interface and creates a JVM in order to execute Java code. How can I debug this Java code while it is being executed within my C++ application? I have all the relevant Java source code, and I'd like to set breakpoints and watch object data within Eclipse.

I've heard of JDPA and JDWP as tools to accomplish this, but I have no idea about the specific steps. Is there a tutorial for this kind of debugging situation?

2 Answers 2

4

This EclipseZone article is a few years old but I think the basic workflow is the same.

Enable remote debugging when starting your JVM within JNI (using the JavaVMInitArgs.JavaVMOption array, see the spec on JNI_CreateJavaVM).

You should then be able to follow the EclipseZone steps using localhost as your remote site.

Sign up to request clarification or add additional context in comments.

Comments

-1

You could run jdb.exe from your c++ application. Here is a nice article that can set you in the right direction.

http://www.javaworld.com/javaworld/javaqa/2000-06/04-qa-0623-jdb.html

Cheers!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.