当前位置: 代码迷 >> Java相关 >> java.net.BindException: Address already in use: JVM_Bind
  详细解决方案

java.net.BindException: Address already in use: JVM_Bind

热度:1100   发布时间:2008-12-04 11:26:54.0
java.net.BindException: Address already in use: JVM_Bind
这问题怎么解决啊,求救
程序代码:

import java.net.*;
import java.io.*;
public class Server {
        public static void main(String[] args) {
         
                ServerSocket server=null;
                try{
                        server=new ServerSocket(8888);  //x1                                                        System.out.println("服务器套接字已经被创建");
                        while(true){  
                                System.out.println("等待客户机");
                                Socket newSocket=server.accept();//x2
                                System.out.println("已与客户机连接");
                        }
                }catch(IOException ie)
                {
                        System.out.println(ie);
                }finally{
                        try
                        {
                            if(server!=null) server.close();//x3
                        }catch(IOException ie){}
                }
        }

}

搜索更多相关的解决方案: already  java  Address  Bind  JVM  

----------------解决方案--------------------------------------------------------
  相关解决方案