Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to enable debug for a Java process after it is started without debug [duplicate]

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?

like image 459
Kaneg Avatar asked Mar 08 '12 07:03

Kaneg


People also ask

How do I enable Java debugging?

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.

How do you debug a program while it is still in use Java?

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.

How do I enable debug logs?

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.


1 Answers

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.

like image 195
Bohemian Avatar answered Sep 20 '22 21:09

Bohemian