How to find port number of a Spring Boot app?

How do I find the port number of my SpringBoot app so I can call it? I already tried setting -Dserver.port=8080 and--server.port=8080 in VM arguments and in src/main/resources/application.properties.

If I try to go to localhost:8080 Chrome says refused to connect. I simply want to be able to connect to my App don't know why Spring Boot made finding which port is being used so challenging.

I'm using Eclipse and the app appears to be running properly from the logs.

This simply printed 0:

@Value("${local.server.port}")
int port;

I've tried these answers none work: Spring Boot - How to get the running port Spring boot - how to get running port and ip address How to configure port for a Spring Boot application How to configure port for a Spring Boot application


localhost:<your port> may not respond at all. Make sure you're hitting an endpoint you know is availible like localhost:8080/info. Make sure your app has completly started, it could take serveral minutes.

As @BrianC mentioned make sure your app is actually a web server.