Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use a jar with source as source for jdb?

I have a executable jar with source compiled in and I want to debug it using jdb (no other debugger available in this environment unfortunately).

I am able to debug it with

jdb -classpath "${JAR_FILE}:${CLASS_PATH}" ${MAIN_CLASS} ${ARGS}

How can I get jdb to use the source that is built into the jar file?

Notes: Java 6, AIX, ksh

like image 485
C. Ross Avatar asked Sep 08 '10 13:09

C. Ross


1 Answers

actually I managed to debug into a jar file without source code today, the steps are as follows:

  1. unzip jar file

  2. jdb -sourcepath [unzipped source folder] -classpath [the path for your main class]

  3. after jdb initializing, excute:

stop at <package>.<yourclass>:<linenunmber>
run <your main class, for example org.springframework.boot.loader.JarLauncher>
  1. after breakpoint triggered, you can step by step debug using jdb command
like image 64
LIU YUE Avatar answered Sep 20 '22 12:09

LIU YUE