Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes Runtime logs Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Runtime logs Query" Watch "Runtime logs Query" New topic

Runtime logs Query

Ra Sank

Joined: Jun 02, 2008
Posts: 14

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.

Learning Java.
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
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 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

Joined: Jun 02, 2008
Posts: 14
Thanks for your updates. Please suggest if anything wrong in below syntax.

java -output "class of mine with args".
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347

It should be...

java -output trace.txt ClassOfYours yourargs
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Runtime logs Query
Similar Threads
Doubt on Servlet having database connection?
Gutters shape...
Unable to create jdbc instances as per the value set in the properties file... please help me
Ch. 10 Development question
Problem with jar-files