ruby-on-railsjrubywarbler

How to run warbler (jruby on rails) on different port rather than 8080


I created a war file named my_sample.war and run java -jar my_sample.war . It runs at port 8080 as default value. What do I do to change it to port 3000. Thanks!


Solution

  • You should be able to pass the port to the java invocation like so:

    java -Dwarbler.port=3000 -jar my_sample.war
    

    Alternatively, setting the environment variable PORT should work:

    PORT=3000 java -jar my_sample.war