H2db jar在8082端口以外的端口不起作用。

huangapple go评论65阅读模式
英文:

H2db jar not working on port other than 8082

问题

我有一个 h2db 的 JAR 文件,我想在端口 8082 以外的端口上运行它。

我尝试了 java -jar -Dserver.port=XXXX,但它仍然在 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?

答案1

得分: 1

我认为要使用的参数是 webPort 而不是 server.port

另外,根据文档,您可能需要在 .h2.server.properties 文件中提供此参数。

文档链接:http://www.h2database.com/html/tutorial.html#console_settings

英文:

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

答案2

得分: 1

你可以使用以下命令:

java -jar h2-*.jar -webPort 9999

其中 h2-*.jar 是 H2 数据库的 jar 文件名,9999 是端口号。

还有 -tcpPort-pgPort 和其他参数。

如果你只想启动 Web 服务器,而不为 JDBC 和 ODBC 客户端打开其他端口,并且在浏览器中打开一个窗口,可以使用以下命令:

java -jar h2-*.jar -web -webPort 9999 -browser
英文:

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

huangapple
  • 本文由 发表于 2020年8月21日 14:19:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/63517487.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定