Description:
Web server failed to start. Port 8080 was already in use.
Action:
Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
翻译:
描述:
Web服务器启动失败。端口8080已经在使用中。
行动:
识别并停止在端口8080上侦听的进程,或将此应用程序配置为在另一个端口上侦听。
运行代码
package com.example.myTest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
public class MyTestApplication {
@GetMapping("/hello")
public String hello() {
return "hello world";
}
public static void main(String[] args) {
SpringApplication.run(MyTestApplication.class, args);
}
}
访问的地址是@