You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Tomcat启动失败(端口198被占用)求助:NetBeans运行Java Web程序遇问题

Fixing "Tomcat failed to start, port 198 is in use" in NetBeans

Hey there, I’ve run into this exact port conflict issue plenty of times—let’s get your Tomcat up and running again with these straightforward solutions:

1. Kill the process using port 198

The quickest fix is to shut down whatever’s hogging port 198. Here’s how to do it on different systems:

Windows

  • Open Command Prompt as administrator, then run:
    netstat -ano | findstr :198
    
    This will show you the PID (process ID) of the program using the port.
  • Next, kill that process with:
    taskkill /F /PID <your-PID-number>
    
    Replace <your-PID-number> with the number you found in the previous step.

Linux/macOS

  • Open Terminal and run:
    lsof -i :198
    
    Or if lsof isn’t installed, use:
    netstat -tulpn | grep :198
    
  • Once you have the PID, terminate the process:
    sudo kill -9 <your-PID-number>
    

2. Change Tomcat’s port number

If you don’t want to kill the existing process, just switch Tomcat to use a different port:

  • Option 1: Edit via Tomcat’s config file
    Navigate to your Tomcat installation directory, go to the conf folder, and open server.xml in a text editor. Look for the <Connector> tag that has port="198"—it’ll look something like this:

    <Connector port="198" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"/>
    

    Change the port value to an unused number (like 8081, 9090, etc.), save the file, then restart Tomcat from NetBeans.

  • Option 2: Update via NetBeans server settings
    In NetBeans, go to Tools > Servers, select your Tomcat server from the list. Click the Connection tab, then modify the "HTTP Port" field to your desired unused port. Save the changes and restart the server.

3. Double-check for conflicting services

Sometimes other apps (like another Tomcat instance, a proxy server, or even some background tools) might be using port 198. Quickly check if you have any other servers running in NetBeans or on your system that could be causing this overlap.

After trying any of these steps, restart your Tomcat server in NetBeans—it should start up without the port conflict error!

内容的提问来源于stack exchange,提问作者Pankaj Yadav

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 04:25:20