0

I have a piece of code where I am creating a Java VM via JNI and then invoking a method on a java .class file.

How do i debug the java code via an IDE say eclipse or Netbeans. My c++ project is setup in visual studio and the java project is setup using eclipse. Till now I was using logs to debug the java code.

1 Answer 1

2

You need to use remote debugging see http://java.dzone.com/articles/how-debug-remote-java-applicat

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

3 Comments

Does this mean that at JNI layer, where I am calling CreateJVM I need to pass the "-Xdebug -Xrunjdwp:transport=dt_socket,address=<portno>,server=y" as a option to the VM?
yes, that's correct. However, In the java control panel, in the java tab, you can set properties there, altho i don't know that settings you put there will be picked up by jvm's loaded thru jni. You might try that first. I don't know never tried it. But what you say will work.
Tried it the following set of options work -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n

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.