端口占用 java.net.BindException: Address already in use: JVM_Bind

报错 java.net.BindException: Address already in use: JVM_Bind ,端口号以绑定,表示端口占用,

 org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]: 
java.net.BindException: Address already in use: JVM_Bind
	at java.net.DualStackPlainSocketImpl.bind0(Native Method)
	at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:96)
	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
	at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
	at java.net.ServerSocket.bind(ServerSocket.java:376)
	at java.net.ServerSocket.(ServerSocket.java:237)
	at org.apache.catalina.core.StandardServer.await(StandardServer.java:420)
	at org.apache.catalina.startup.Catalina.await(Catalina.java:713)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:659)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

解决方案: 把打开的tomcat关闭重启即可,或者进入tomcat安装目录的bin文件夹下的shutdown.bat关闭即可重新使用。
1.先用命令 netstat -ano 看一下各个端口占用和进程PID(8080端口是被3296占用) 。 
2.然后在任务管理器里,查看进程。(注意:默认情况下,进程的PID是不显示的,你在菜单的查看->选择列里可以选上PID来显示) 

 

最后提醒一下,使用netstat 命令查看端口号时,查看的是Local Address 列的端口号。

 

 

 

 

 

 

你可能感兴趣的:(java)