javaporth2h2db

H2db jar not working on port other than 8082


I have a h2db jar which i want to run on port other than 8082.

I tried java -jar -Dserver.port=XXXX but it is still running on 8082.

Is there any way to run it on other port?


Solution

  • You can use

    java -jar h2-*.jar -webPort 9999
    

    where h2-*.jar is the name of H2's jar file and 9999 is a port number.

    There are also -tcpPort, -pgPort and other parameters.

    If you want to start the web server only without other open ports for JDBC and ODBC clients and open a browser window, use

    java -jar h2-*.jar -web -webPort 9999 -browser