I am currently trying to create a web application with Spring Boot. I need to host my application to localhost:8081
. How do I change the port?
Actually you want to change server.port
and you can change it in many different ways as described http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config
Examples:
command line
java -Dserver.port=$PORT -jar target/demo-0.0.1-SNAPSHOT.jar
and much more