Possible Duplicate:
Debug a java application without starting the JVM with debug arguments
For example, can the debug mode be enabled in JVM itself by code?
Click Java > JVM Settings tab. Under Debug Java Settings, select the Enable Debug checkbox. Provide JVM options as necessary by clicking the New button. If you substitute suspend=y, the JVM starts in suspended mode and stays suspended until a debugger attaches to it.
Breakpoints A breakpoint is a signal that tells the debugger to temporarily suspend execution of your program at a certain point in the code. To define a breakpoint in your source code, right-click in the left margin in the Java editor and select Toggle Breakpoint. Alternatively, you can double-click on this position.
Launch Event Viewer. Select View\Show Analytic and Debug Logs. Navigate to Event Viewer (Local)\Applications and Service Logs\Microsoft\User Experience Virtualization\App Agent. Right-click on Debug under App Agent and select Enable Log.
The answer is no - if the JVM was not started with the debug option you can't connect to its debug port.
There may be special profiler type JVMs that allow it, but it's not possible with any of the standard JMVs - for obvious security reasons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With