how to force stop Intellij on linux

65.8k views Asked by At

I am using a scratch file for some Kotlin work.

  • I accidentally created an endless loop in one of my functions and ran the file, so Intellij is not responding.

  • There is no button for stopping the execution of the scratch file and even if there were, that wouldn't work because Intellij is not responding to mouse clicks.

How do I force stop or restart Intellij in this case?

5

There are 5 answers

1
Gaurav On

Already good answers are given above.

Another great way to find IntelliJ PID is to use htop command on Linux.

  1. Install htop with the command: sudo apt install htop
  2. Run htop in terminal
  3. In the tabular format, PID is associated with each process including IntelliJ.
  4. Run kill -9 <pid_of_intellij> to kill the IntelliJ process.
2
rgen3 On

You can kill the process by name using

pkill -9 intellij

or by

killall -9 intellij

or even

kill -9 $(ps aux | grep intellij | awk '{print $2}')
1
Giorgos Myrianthous On

You first need to find Intellij's process id:

ps -f | grep -i intellij

and then kill the process id (PID):

kill -9 PID
0
AyupovFN On

You can use xkill then move the cursor from X to the window you need for example with (ide) This works provided that you are not completely frozen OS

0
mflorczak On

I tried with intellij but it doesn't work. On my ubuntu this command is working pkill -9 idea