171 |
171 |
172 To run Java program in debugger:: |
172 To run Java program in debugger:: |
173 |
173 |
174 $ jdb -cp $CLASSPATH -sourcepath $SRC_DIR |
174 $ jdb -cp $CLASSPATH -sourcepath $SRC_DIR |
175 |
175 |
176 To attach to Java application you should run application as:: |
176 To attach to Java application you should run application for Java 1.4:: |
177 |
177 |
178 $ java -Xdebug -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=$PORT \ |
178 $ java -Xdebug -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=$PORT \ |
|
179 com.vendor.product.Clazz |
|
180 |
|
181 for Java including & above 5:: |
|
182 |
|
183 $ java -agentlib:jdwp=transport=dt_shmem,server=y,suspend=n,address=$PORT \ |
|
184 com.vendor.product.Clazz |
|
185 |
|
186 for Java 9 you need to set host:: |
|
187 |
|
188 $ java -agentlib:jdwp=transport=dt_shmem,server=y,suspend=n,address=*:$PORT \ |
|
189 com.vendor.product.Clazz |
|
190 |
|
191 $ java -agentlib:jdwp=transport=dt_shmem,server=y,suspend=n,address=localhost:$PORT \ |
179 com.vendor.product.Clazz |
192 com.vendor.product.Clazz |
180 |
193 |
181 and then attach with debugger:: |
194 and then attach with debugger:: |
182 |
195 |
183 $ jdb -attach $PORT |
196 $ jdb -attach $PORT |