简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM