Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Runtime logs Query

 
Ra Sank
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there any "options" in below syntax for getting logs which contains all the method it reaches or touches on its execution in console.

java -"x" <jar file>



Note: If it is available in any links containing all options also please provide.

Thanks in Advance.
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to get a trace of your program?
This may not be an elegant or sophisticated solution, but you can try the Trace demo program
that comes with the jdk.

This is what you have to do.

-Assuming you are using jdk 1.6, extract the source files in demo\jpda\examples.jar
-you can either use the jar utility or a file extractor that supports the zip format to extract
-compile the classes under \com\sun\tools\example\trace. You may need to have \lib\tools.jar in your
classpath for the compilation
-Run your program as java com.sun.tools.example.trace.Trace HelloWorld. You need to have \lib\tools.jar. You can use the -output option
to Trace, to send the trace to a file.

Refer this
and this here to for additional help.

As for the -X option you are looking for.. I don't think there is such an option.

Hope this helps..
 
Ra Sank
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your updates. Please suggest if anything wrong in below syntax.

java -output "class of mine with args".
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ummm..

It should be...

java com.sun.tools.example.trace.Trace -output trace.txt ClassOfYours yourargs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic