the right way to kill a java thread on Windows?
- From: "john" <johnbkim@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 15:08:33 -0700
I used NetBeans + JDK 1.5.2 to write a simple program using the SocketServer
class, on my Windows 2000 pc. The program dies not die when I kill it. I
kill it by right-clicking on the process in the execution window and
selecting "terminate." It appears to die within NetBeans but when I start
it, the SocketServer instance complains that the port is not available. The
Windows command "netstat -a" confirms that there is still a process
listening at the port, and Windows Task Manager also shows a java.exe
process running. If I kill that java.exe process from the Task Manager, then
everything is ok again -- I can restart my program and listen on the port
again.
What is the right way to kill a program like mine, so that it releases the
port?
Thanks,
John
(remove the pachyderm to reply)
.
- Follow-Ups:
- Re: the right way to kill a java thread on Windows?
- From: R.F. Pels
- Re: the right way to kill a java thread on Windows?
- From: Ross Bamford
- Re: the right way to kill a java thread on Windows?
- Prev by Date: Re: Generics and ClassLoaders
- Next by Date: Re: parse int from string
- Previous by thread: Java Newbie... Read file at HTTP
- Next by thread: Re: the right way to kill a java thread on Windows?
- Index(es):
Relevant Pages
|