It feels like a dumb question to ask, but i cant seem to figure it out. when i run a *.jar file on windows it doesnt apears in the taskmanager processes. how can i terminate it , i have tried TASKKILL but it also doesnt work for me.
If you want to kill all java.exe processes : taskkill /F /IM java.exe /T .
In Java exit() method is in java. This System. exit() method terminates the current JVM running on the system which results in termination of code being executed currently.
On Linux
ps -ef | grep java
It will show u a list of processes out of which one will be your executable jar. Just kill that process by its process id.
sudo kill -9 <pid>
Is there any way to do this from the java code of the same jar file. Like killing itself once process completed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With