Tejas C
Tejas C

Reputation: 413

Debug a running java application in eclipse?

I am developing a java application which gathers some data, processes it and serialize them every 30 minutes into a file which makes it a time sensitive in that way. During the test mode, this writing-to-file feature is disabled.

I started the application by mistake in test mode and it is running since last few hours collecting data in memory but data isn't written into file as application is running in test mode. Though it would keep collecting data until it writes it into a file, which would never happen.

Is there a way to change the execution mode from "run" to "debug" or pause it and run some operations on in-memory data such as run a method manually that write them in a file?

Upvotes: 1

Views: 166

Answers (1)

Chris Gerken
Chris Gerken

Reputation: 16390

Sorry to say, but no. When you run in debug mode, the JVM is started in such a way that a debugger can interact with the running classes. An already running JVM would not allow those collaborations post-startup, partially by inadvertent design and partially as a security measure.

Upvotes: 4

Related Questions