简体   繁体   中英

Is there a way to pause/resume execution of a running Java program in Eclipse on Windows?

In Linux, it's possible to pause/resume execution using kill. Is there a way to do that on Windows?

You can go to Eclipse console and click red square for the process you want to stop. The different processes running are available in dropdown on console itself.

Many a times, processes like SVN synch etc. just hang up and user has to close Eclipse itself and restart it. This is something observed in Eclipse version 2020 as well.

On linux, kill command doesnt pause the process, instead it kills its pid and stops the process.

To do the same on Windows:

You must use Task Manager (Alt+Ctrl+Del on Windows) to kill process. Go to tab Processes, find process javaw.exe* and click End Process. javaw.exe is the java process without any console.

So, process in Eclipse will be closed but your Eclipse will not be closed.

Kill on Linux actually stops the process, you cannot resume it.

If it's a console application and you just want to pause at a certain known execution point in your code, just use a Scanner and wait for a user's input

Scanner scanner = new Scanner(System.in);
scanner.nextLine();

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