"Unknown source code"

4

418928

Hi everybody,

I'm not sure under which conditions, when printing a stack trace, the
"unknown source code" is shown instead of the line in the source code
where the exception was thrown. Not knowing the line make debugging
more difficult... I thought it was only with code developed by third
parties, but in one example I have developed on my own it also
happens. Maybe because I'm using jars to package the .class files? Or
because I'm doing tests with networking? Thanks in advance for any
clarification,

Sergio
 
T

Thomas Kellerer

Hi everybody,

I'm not sure under which conditions, when printing a stack trace, the
"unknown source code" is shown instead of the line in the source code
where the exception was thrown. Not knowing the line make debugging
more difficult... I thought it was only with code developed by third
parties, but in one example I have developed on my own it also
happens. Maybe because I'm using jars to package the .class files? Or
because I'm doing tests with networking? Thanks in advance for any
clarification,

This happens when you compile your code without the -g switch (or with -g:none)

Third party libraries are often compiled in this way because it makes the
generated class files smaller.

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top