Kill Eclipse background operation without killing Eclipse

Eclipse

Eclipse Problem Overview


Is there any way to kill an Eclipse background operation without killing Eclipse itself?

Specifically, I want to kill stalled Subclipse SVN operations. Clicking 'cancel' pops up a little Cancel Requested message, but the operation still sits there forever blocking everything else.

This is Eclipse Helios on Windows 7 if that makes any difference.

Eclipse Solutions


Solution 1 - Eclipse

Killing the task from the Progress window (Window->Show View->Other|General->Progress or Alt+Shift+Q, Q | General->Progress).

Then choose the offending thread and click the red square.

Note it sometimes takes a delay before the kill occur, you may also have to kill other thread in there to get what you want. Lastly it does not always work, if this fails I usually just restart eclipse.

Hope this helps

Solution 2 - Eclipse

I was able to unstuck Eclipse (it was stuck on a large file diff) using the following steps.

  • Preparations: I always start Eclipse with the eclipse-console: Add start parameter -console in eclipse.ini (first line)
  • The console always remains responsive even when the eclipse UI freezes
  • I found the following commands in the console: help threads
  • List all threads: threads
  • Stop a thread: threads stop THREAD-NAME

UPDATE: I found out, that usually the "main" thread causes the freezing. Thus the solution is:

Type this in the eclipse console:

threads stop main

This will trigger/throw an Exception in that thread, effectively interrupting what it was doing (being stuck).

This might cause other side-effects (depending on what action was interrupted and where), but i had no problems with it so far.

Solution 3 - Eclipse

I was able to stop/terminate the hanging SVN commit process by briefly disconnecting the network adapter. This saved me from killing the Eclipse process, which if not terminated gracefully is known to cause other headaches.

Solution 4 - Eclipse

If you go to window Progress in Eclipse and click red square to Stop:

Stopping Wildfly 9.x

and next, red square becomes gray square and process i frozen (Cancel Requested):

eStopping Wildfly 9.x Cancel Requested

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

The result: frozen process in Eclipse was closed but your Eclipse wasn't closed.

* Process with name javaw.exe is for WildFly server. For Subclipse SVN can be another name of proces.

Solution 5 - Eclipse

I'm not sure, but from the Debug perspective, you may be able to view the thread that's performing the background operation and kill it from there for quicker exit.

Solution 6 - Eclipse

In console window, open "Open OSGi Console" from drop button. In this console you can type command threads. This will show all running threads. You can kill process with command threads stop '<Process name>'. Remember to use single apostrophe ' surrounding <Process name>, otherwise it won't work.

For example, I had to type:

threads stop 'Worker-12: Refresh DSLD scripts'

Solution 7 - Eclipse

I had a problem where the external compiler I was using froze up when I tried to cancel the build operation. It was stuck in the "Cancel Requested" state. I went to the Windows Task Manager and found my compiler process and terminated it. That allowed Eclipse to continue and successfully cancel the operation.

Solution 8 - Eclipse

Keep clicking on clean console, it will show the back ground processes, keep killing one by one.

Solution 9 - Eclipse

I made this by opening console in eclipse and typing 'threads'. And then 'threads stop thread-name'.

Solution 10 - Eclipse

In Lunux you can list all the Eclipse processes

ps -edf | grep eclipse

Then you choose the child process (the backgound doing Java process) of the main process (the Eclipse GUI Java process) of the starting shell process.

Example:

myself   21821  1222  0 09:28 ?    00:00:00 /local/eclipse/jee-2021-06/eclipse
myself   21839 21821  8 09:28 ?    00:24:53 /usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java -Dosgi.requiredJavaVersion=11 [email protected]/eclipse-workspace ... much more ...
myself   21965 21839  0 09:29 ?    00:01:48 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -cp /local/eclipse/jee-2021-06/eclipse/../../../../home/myself/.p2/pool/p ... much more ...

The child in the chain of processes is the one with the proc-id 21965. This one you have to kill. Try kill -2 <proc-id> and, if it did not work, kill -9 <procid>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRob AgarView Question on Stackoverflow
Solution 1 - EclipseNewtopianView Answer on Stackoverflow
Solution 2 - EclipseFrederic LeitenbergerView Answer on Stackoverflow
Solution 3 - EclipseA KhazaalView Answer on Stackoverflow
Solution 4 - EclipsemkczykView Answer on Stackoverflow
Solution 5 - EclipseSavitha GanpathiView Answer on Stackoverflow
Solution 6 - EclipsekosteklvpView Answer on Stackoverflow
Solution 7 - EclipseBrian BView Answer on Stackoverflow
Solution 8 - EclipseLeoView Answer on Stackoverflow
Solution 9 - Eclipseuser15620306View Answer on Stackoverflow
Solution 10 - EclipseJBStonehengeView Answer on Stackoverflow