tags:

views:

47

answers:

3

Is it possible to bring up a Java console window in Win XP that shows detailed debugging and tracing info for whatever is happening to the JVM at the moment?

There are a few proprietary JAR files that I am using and I want to pick up some details on what is going wrong. Is this possible?

A: 

Use javaw.exe instead of java.exe when launching your application to bring a console. For the content of the console, I am not sure you can have info on external Jars if these libraries doesn't provide a "debug" mode using for example command lines parameters

Manuel Selva
+2  A: 

There is no "the JVM". Whenever you start a Java application, a new JVM is started. If you have multiple Java processes running, you have multiple JVMs running.

Java 6 includes a nice tool, VisualVM. You can start it by running jvisualvm. It allows you to monitor many aspects of Java processes, such as running threads, garbage collection etc.

Java 5 included something similar, but simpler, JConsole.

Jesper
@Jesper: will either of these tools show debugging or tracing information for external JARs?
Craig Johnston
No, those tools are not debuggers. If you want a debugger, use an IDE such as NetBeans or Eclipse. VisualVM can do performance and memory profiling.
Jesper
A: 

You can enable the Java Console in the Java Control Panel. This gives you not as much as you ask for as there is no default logging and tracing. It is primarily for those needing to do simple investigations.

If you need to investigate an actual problem, a good debug session allows you to set breakpoints on the points you need to investigate, a good decompiler allows you to see the reconstructed code, and a profiler allows you to pinpoint where the bottlenecks are. The jvisualvm tool in the JDK is very powerful, contains a profiler and worth learning well.

I use jvisualvm with Eclipse with the jadclipse decompiler plugin, and that is quite helpful.

Thorbjørn Ravn Andersen
I have done that however the console does not show.
Craig Johnston