如何在SpringBOOT中传递JVM参数 [英] How to pass JVM arguments in SpringBOOT

查看:2634
本文介绍了如何在SpringBOOT中传递JVM参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在主Spring Boot类中传递JVM参数,在该类中我们将启动Spring Boot应用程序.

I would like to pass JVM arguments in the main spring boot class where we will be starting the spring boot application.

能否请您分享如何在Spring Boot应用程序中设置JVM参数?

Could you please share how to set JVM arguments in spring boot application?

我尝试了以下选项,但没有运气

I tried the below options and there is no luck

System.setProperty("http.proxyHost", "X.X.X.X");
System.setProperty("http.proxyPort", "8080");

或者您可以将其用于弹簧靴

or you can use this for spring boot

bootRun {
    systemProperties "property1": "value1", "property2": "value2"
}

推荐答案

此选项看起来很有希望.

This option looks promising.

$ java -jar <jar-name> [--key1="value1"]... [--keyN="valueN"]

这篇关于如何在SpringBOOT中传递JVM参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆