0

I am trying to debug a jar file with attached source code. I am able to debug it step by step, but unable to see any variable values.

Can anyone help me with this?

1 Answer 1

0

In order to see variable values in Java bytecode, it needs to be compiled with debug symbols. A typical release version of a jar will not have this debug info.

Related: Why are some java libraries compiled without debugging information

Typically, in this case I make a debug variable in my own code before the breakpoint, something like:

...
int debugVal = libraryClass.getValueIWantToDebug();
System.out.println("Breakpoint");
...

Then you'll have the value in your own code, which will be accessible during debug.

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

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.