Search code examples
javajarkill-process

Java: How to stop a Executable jar which never terminates


I have a runnable jar which won't shutdown. i have executed it in my windows machine by double clicking on it. How can i terminate that application.

I dont what to kill all java.exe processes as i want other apps to run


Solution

  • There are three options:

    • Start in commandline with java -jar [YourJarPath] (Close by (Ctr + C) or close your commandline
    • Restart your Windows
    • Terminate it per TaskManager (Ctr+Alt+Del)

    Under "Details" TaskManager Taskbar

    Then look for "javaw.exe". Right Click and then something like Shutdown or exit Task. enter image description here

    To find the jar name, start in cmd (commandline) this code:

    C:\Program Files\Java\[YOUR JAVA VERSION]\bin\jps.exe

    it will return something like this: Img

    The number befor the "name" is your PID that is also listed in the taskmanager right next to javaw.exe