java.rst
changeset 2401 7f6cf1952337
parent 2357 107d39975281
child 2405 b596469f32fc
equal deleted inserted replaced
2400:bdff41e50608 2401:7f6cf1952337
   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
   332 
   345 
   333 Java interactive shell.
   346 Java interactive shell.
   334 =======================
   347 =======================
   335 
   348 
   336 Just use Groovy. ``bsh`` is older alternative without code completion.
   349 Just use Groovy. ``bsh`` is older alternative without code completion.
       
   350 
       
   351 Object pretty-print
       
   352 ===================
       
   353 ::
       
   354 
       
   355   org.apache.commons.lang3.builder.ToStringBuilder.reflectionToString()
       
   356   org.apache.commons.lang3.builder.ReflectionToStringBuilder.toString()