H2db jar not working on port other than 8082

441 Views Asked by At

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?

2

There are 2 best solutions below

1
Evgenij Ryazanov On BEST ANSWER

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
1
Victor On

I think the parameter to be used is webPort and not server.port.

Also you might have to provide this parameter in the .h2.server.properties file as stated in the documentation:

http://www.h2database.com/html/tutorial.html#console_settings