The issue arises because the grep command itself appears in the process list, but it exits immediately after execution. By the time you try to kill it, the process no longer exists. Here's how to properly identify and terminate an IcedTea applet process:
Step-by-Step Solution
1. Check for Active IcedTea/Java Processes
Run this command to list all Java-related processes:
ps -ef | grep -i java
Look for entries containing icedtea, applet, or javaws. Example output:
anastas+ 12345 1 0.0 0.1 123456 7890 pts/0 Sl 08:00 0:00 /usr/bin/java -jar applet.jar
2. Narrow Down the Process
If the above shows multiple Java processes, filter further:
ps -ef | grep -i 'icedtea\|applet\|javaws'
3. Kill the Correct Process
Once you identify the correct PID (e.g., 12345), terminate it:
kill 12345
If it resists, force-kill:
kill -9 12345
4. Verify Termination
Confirm the process is gone:
ps -ef | grep -i 'icedtea\|applet\|javaws'
Common Pitfalls
- No IcedTea Applet Running: If no matching processes are found, the applet might not be active. Modern browsers no longer support Java applets, so ensure you're running it via a legacy tool (e.g.,
javaws or appletviewer).
- Incorrect PID: Avoid killing unintended processes. Always double-check the command line arguments in the
ps output.
- Browser Integration: If the applet runs in a browser, closing the browser tab or restarting the browser might suffice.
Example Workflow
# List all Java processes
ps -ef | grep -i java
# Output might show:
# anastas+ 12345 1 0.0 0.1 123456 7890 pts/0 Sl 08:00 0:00 /usr/bin/java -jar applet.jar
# Kill the process
kill 12345
If you still can't find the process, it may not exist. Let me know if you need further help!