I am running my java class as below and now I want kill this java process with out using PID. I want to use dharsha. Is this possible? If not tell how can I kill the java process programmatically or command in windows
start "dharsha" java Main
you can run a taskkill
taskkill /f /im javaw.exe
or
taskkill /f /im java.exe
I think this one is more efficient:
wmic process where "name like '%java%'" delete
For specific application:
FOR /F "tokens=1,2 delims= " %%G IN ('jps -l') DO IF %%H=myMainclass taskkill /F /PID %%G
//myMainClass stands for your application's main class
start names the window not the process, but taskkill can filter on that slightly less conveniently taskkill /f /fi "windowtitle eq dharsha"