Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmArgs field in the launch.json file is not parsed or used. #469

Open
bayang opened this issue Jan 31, 2024 · 2 comments
Open

vmArgs field in the launch.json file is not parsed or used. #469

bayang opened this issue Jan 31, 2024 · 2 comments

Comments

@bayang
Copy link

bayang commented Jan 31, 2024

Describe the bug
vmArgs field in the launch.json file is not parsed or used.

Emacs 29.1 + latest doom emacs

To Reproduce

using a launch.json file that works in vscode to launch a spring boot app. The vmArgs field is used to set the config location. If this field is not set the app can't start.

Case 1, not working, I used this file :

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "launch-from-json",
            "request": "launch",
            "args" : "",
            "vmArgs": "-Dspring.config.location=classpath:application.properties,file:/home/user/perso/app-data/app.properties",
            "mainClass": "io.github.me.app.App",
            "projectName": "my-app"
        }
    ]
}

output in lsp-log buffer, vmArgs is null :

31 janv. 2024, 08:31:48 Launching debuggee VM succeeded.
31 janv. 2024, 08:31:59 Debug connection closed
31 janv. 2024, 08:32:17 Trying to launch Java Program with options:
main-class: io.github.me.app.App
args: 
module-path: 
class-path: /home/user/perso/app-data/target/classes:/home/user/.m2/repository/org/springframework/...blah
vmArgs: null
31 janv. 2024, 08:32:17 Launching debuggee VM succeeded

If instead, I put the config line in the args, like in the modified launch.json file below then it works, the app starts :

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "launch-from-json",
            "request": "launch",
            "args" : "--spring.config.location=classpath:application.properties,file:/home/user/perso/app-data/app.properties",
            "vmArgs": "",
            "mainClass": "io.github.me.app.App",
            "projectName": "my-app"
        }
    ]
}

logs from lsp-log buffer, args is set :

31 janv. 2024, 08:32:21 Debug connection closed
31 janv. 2024, 08:33:59 Trying to launch Java Program with options:
main-class: io.github.bayang.diarycompanion.App
args: --spring.config.location=classpath:application.properties,file:/home/user/perso/app-data/app.properties
module-path: 
class-path: /home/user/perso/app-data/target/classes:/home/user/.m2/repository/org/springframework/blah
vmArgs: null
31 janv. 2024, 08:33:59 Launching debuggee VM succeeded.

I also tried to fill args AND vmArgs in the json file and the output in the lsp-log is same as above : args is filled but vmArgs is null.

@yyoncho
Copy link
Member

yyoncho commented Jan 31, 2024

I believe these should be a vector, not a string.

@bayang
Copy link
Author

bayang commented Jan 31, 2024

Ok, I tried to modify my json like this :

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "launch-from-json-vec",
            "request": "launch",
            "args" : "",
            "vmArgs": ["-Dspring.config.location=classpath:application.properties,file:/home/user/perso/app-data/appproperties"],
            "mainClass": "io.github.me.appApp",
            "projectName": "my-app
        }
    ]
}

The app does not start and Lsp logs output this :

31 janv. 2024, 12:05:53 Debug connection closed
31 janv. 2024, 12:06:13 Trying to launch Java Program with options:
main-class: io.github.me.appApp
args: 
module-path: 
class-path: /home/user/perso/app-data/target/classes:/home/ubik/.m2/repository/org/springframework/org/blah
vmArgs: null
31 janv. 2024, 12:06:13 Launching debuggee VM succeeded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants