Rob Agar
Rob Agar

Reputation: 12459

Kill Eclipse background operation without killing Eclipse

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.

Upvotes: 53

Views: 59267

Answers (10)

JBStonehenge
JBStonehenge

Reputation: 261

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>

Upvotes: 0

user15620306
user15620306

Reputation:

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

Upvotes: 0

Leo
Leo

Reputation: 11

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

Upvotes: 0

kosteklvp
kosteklvp

Reputation: 198

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'

Upvotes: 2

Frederic Leitenberger
Frederic Leitenberger

Reputation: 2019

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.

Upvotes: 7

mkczyk
mkczyk

Reputation: 2710

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.

Upvotes: 4

A Khazaal
A Khazaal

Reputation: 59

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.

Upvotes: 5

Brian B
Brian B

Reputation: 1

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.

Upvotes: 0

Savitha Ganpathi
Savitha Ganpathi

Reputation: 11

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.

Upvotes: 1

Newtopian
Newtopian

Reputation: 7732

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

Upvotes: 8

Related Questions