<p>When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application running on my machine. Is there a better way than just randomly killing java.exe processes in hope that you'll hit the correct application eventually?</p>

<p><strong>EDIT:</strong> Thank you to all the people who pointed me to Sysinternal's Process Explorer - Exactly what I'm looking for!</p>

[{'answer_id': 62431, 'author': 'Raithlin', 'author_id': 6528, 'author_profile': 'https://Stackoverflow.com/users/6528', 'pm_score': 3, 'selected': False, 'text': '<p>Have you tried using Process Explorer from SysInternals? It gives a much better idea of what is running within the process. Available free online here: <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="noreferrer">http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx</a></p>\n'}, {'answer_id': 62440, 'author': 'Henry B', 'author_id': 6414, 'author_profile': 'https://Stackoverflow.com/users/6414', 'pm_score': 1, 'selected': False, 'text': '<p>I\'d suggest downloading Process Explorer from Sysinternals and looking at the different java.exe processes more closesly, that way you can get a better idea of which one to kill.</p>\n\n<p><a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="nofollow noreferrer">http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx</a></p>\n\n<p>It\'s very intuitive and you can find the java.exe processes and right click and goto their properties, from there you can see their command line, time of creation, etc which can help you find the process you want to kill.</p>\n\n<p>Hope it helps.</p>\n'}, {'answer_id': 62448, 'author': 'user6837', 'author_id': 6837, 'author_profile': 'https://Stackoverflow.com/users/6837', 'pm_score': 1, 'selected': False, 'text': '<p>Using <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="nofollow noreferrer">ProcessExplorer</a> and hovering over the Java process will show the command line.</p>\n'}, {'answer_id': 62457, 'author': 'Ricardo Reyes', 'author_id': 3399, 'author_profile': 'https://Stackoverflow.com/users/3399', 'pm_score': 6, 'selected': True, 'text': '<p>Download <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="noreferrer">Sysinternal\'s Process Explorer</a>. It\'s a task manager much more powerfull than Windows\'s own manager. </p>\n\n<p>One of it\'s features is that you can see all the resources that each process is using (like registry keys, hard disk directories, named pipes, etc). So, browsing the resources that each java.exe process holds might help you determine wich one you want to kill. I usually find out by looking for the one that\'s using a certain log file directory.</p>\n'}, {'answer_id': 62502, 'author': 'snafu109', 'author_id': 6786, 'author_profile': 'https://Stackoverflow.com/users/6786', 'pm_score': 2, 'selected': False, 'text': '<p>You could try opening Windows Task Manager, going to the Applications tab, right clicking the application and then selecting "Go To Process". This will automatically highlight the appropriate process in the Processes tab.</p>\n'}, {'answer_id': 62516, 'author': 'Mikezx6r', 'author_id': 5382, 'author_profile': 'https://Stackoverflow.com/users/5382', 'pm_score': 1, 'selected': False, 'text': "<p>If the application is not responding at all, then Process Explorer is a good option.</p>\n\n<p>If it's sort of responding, but not dying, sometimes bringing up task manager, and then moving another dialog over the java process will give you a clue. The java process that's taking up cpu cycles to redraw is the one you're looking for.</p>\n"}, {'answer_id': 62517, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>In case you\'re developing software: use a java-launcher. I used for a few of my application [Exe4j][<a href="http://www.ej-technologies.com/products/exe4j/overview.html]" rel="nofollow noreferrer">http://www.ej-technologies.com/products/exe4j/overview.html]</a> and it worked very well. When the application is started, it\'s listed as for example "myserverapp.exe" or "myapp" in the windows tasks manager.\nThere are other lauchers too (don\'t known them by heart), few of them might be for free too.</p>\n'}, {'answer_id': 62571, 'author': 'Tom Hawtin - tackline', 'author_id': 4725, 'author_profile': 'https://Stackoverflow.com/users/4725', 'pm_score': 3, 'selected': False, 'text': '<p>Using jps in the JDK will give you more information. More information is display with the -m, -l and -v options.</p>\n'}, {'answer_id': 63246, 'author': 'TREE', 'author_id': 6973, 'author_profile': 'https://Stackoverflow.com/users/6973', 'pm_score': 1, 'selected': False, 'text': "<p>Rather than using a third party tool, you can also make a pretty good guess by looking at all the columns in task manager if you know roughly what the various java processes on your system are. From the Processes tab, use View-> Select Columns and add PID, CPU Time, VM Size, and Thread count. Knowing roughly what the process is doing should help narrow it down. </p>\n\n<p>For example, in a client-server app, the server will likely use more memory, have more threads, and have used more CPU time because it has been running longer. If you're killing a process because it's stuck, it <em>might</em> simply be using more CPU right now. </p>\n\n<p>MAX java heap memory is usually directly reflected in VM Size. So if you're using -Xmx flags, the process with the larger setting will have a larger VM Size. </p>\n"}, {'answer_id': 63655, 'author': 'Misha', 'author_id': 7557, 'author_profile': 'https://Stackoverflow.com/users/7557', 'pm_score': 6, 'selected': False, 'text': '<p>Run <code>jps -lv</code> which shows PIDs and command lines of all running Java processes. </p>\n\n<p>Determine PID of the task you want to kill. Then use command:</p>\n\n<pre><code>taskkill /PID &lt;pid&gt;\n</code></pre>\n\n<p>to kill the misbehaving process.</p>\n'}, {'answer_id': 63659, 'author': 'Bill Michell', 'author_id': 7938, 'author_profile': 'https://Stackoverflow.com/users/7938', 'pm_score': 3, 'selected': False, 'text': "<p>If you're using Java 6, try <code>jvisualvm</code> from the JDK bin directory.</p>\n"}, {'answer_id': 3504584, 'author': 'Jesse', 'author_id': 423045, 'author_profile': 'https://Stackoverflow.com/users/423045', 'pm_score': 5, 'selected': False, 'text': '<p>If you can\'t run a GUI application like ProcessExplorer and you\'re looking for the "Command Line" arguments of the processes then you can use "wmic" via the command line.  For example:</p>\n\n<pre><code>wmic PROCESS get Processid,Caption,Commandline\n</code></pre>\n\n<p>If you want to look for a specific process you can do this:</p>\n\n<pre><code>wmic PROCESS where "name like \'%java%\'" get Processid,Caption,Commandline\n</code></pre>\n\n<p>The output from this will show you all of the command line arguments of processes like "java."</p>\n'}]
['https://Stackoverflow.com/questions/62418', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6094/']