vsCode - 如何为 Spring Boot 项目添加 JVM 参数 [英] vsCode - How to add JVM argument for Spring Boot project

查看:191
本文介绍了vsCode - 如何为 Spring Boot 项目添加 JVM 参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我在 eclipse 上完成的项目转移到 vsCode.我在 eclipse 中为这个项目有一个运行配置,它有以下 JVM 参数:

I'm trying out vsCode by moving a project I did on eclipse to it. I had a run configuration in eclipse for this project which had the following JVM arguments :

--module-path lib/javafx-sdk-13/lib --add-modules=javafx.controls

当然,这个lib"文件夹及其内容会跟随到新的 vsCode 项目文件夹中,但我不知道将这些 JVM 参数放在 vsCode 中的什么位置,本质上相当于 eclipse 的运行配置.我尝试将它们放在 launch.json 文件的 args 部分,但没有成功.

Of course this "lib" folder and its contents followed to the new vsCode project folder but I don't know where to put those JVM arguments in vsCode, the equivalent of the run configurations with eclipse essentially. I tried putting them in the args section of the launch.json file with no success.

我正在使用 spring boot 仪表板来启动项目,如果这有所不同的话.

I am using the spring boot dashboard to launch the project if that makes a difference.

这是我的launch.json文件:

Here is my launch.json file :

{
"configurations": [
    {
        "type": "java",
        "name": "Spring Boot-BudgetApplication<budget>",
        "request": "launch",
        "cwd": "${workspaceFolder}",
        "console": "internalConsole",
        "mainClass": "com.someone.budget.BudgetApplication",
        "projectName": "budget",
        "args": ["--module-path","lib/javafx-sdk-13/lib","--add-modules=javafx.controls"]
    }
]

}

谢谢

推荐答案

解决方案是将 args 放在 vmArgs 部分,如下所示:

The solution was placing the args in the vmArgs section like so :

"vmArgs": "--module-path=lib/javafx-sdk-13/lib --add-modules=javafx.controls"

这篇关于vsCode - 如何为 Spring Boot 项目添加 JVM 参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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