I am aware of two solutions:
1) At the webpage of Heroku Dev Centre describing the Configuring WAR Deployment with the Heroku CLI, you find the Configuring Tomcat Options which describes commands configuring the way a war file will be executed on the server by setting the WEBAPP_RUNNER_OPTS
configuration variable on your application with a wide range of options described at Webapp Runner: Options. You might find the --port
interesting that is set to 8080
by default and can be configured like:
heroku config:set WEBAPP_RUNNER_OPTS="--port=9090"
2) Another solution is at Heroku Dev Centre Create a Java Web Application Using Embedded Tomcat.
Basically, it means that the application will be launched on the embedded Tomcat using dependencies. This provides an ability to configure the Tomcat directly at the code-base of your project.
Tomcat tomcat = new Tomcat();
tomcat.setPort(Integer.valueOf("9090"))
// defining context and localizing resources
tomcat.start();
tomcat.getServer().await();