-1

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?

Yatin Kanyal
  • 195
  • 1
  • 13
  • Does this answer your question? [Set port number for the embedded h2 database](https://stackoverflow.com/questions/47587960/set-port-number-for-the-embedded-h2-database) – Victor Aug 21 '20 at 06:25

2 Answers2

1

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

Victor
  • 2,450
  • 2
  • 23
  • 54
  • i am not dealing with the code. i just downloaded the jar and want to run at diff port number with some arguement like -Dserver.port=XXXX – Yatin Kanyal Aug 21 '20 at 08:08
1

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
Evgenij Ryazanov
  • 6,960
  • 2
  • 10
  • 18