javaVSCode icon indicating copy to clipboard operation
javaVSCode copied to clipboard

Property env is not allowed'

Open garrettmaring opened this issue 7 years ago • 3 comments

Adding an 'env' property to a launch configuration shows 'Property env is not allowed'. However, this is referenced in the docs for how to set the jdk. Is env supported?

If not, how do you pass environment variables (not program arguments) to the launch command?

garrettmaring avatar Aug 08 '17 22:08 garrettmaring

Hi, ${env:JAVA_HOME}/bin was suggested by a contributor.

screenshot_20170808_180727

Currently env is working fine for me

Do you have some special configuration? If not, you can use the absolute path instead, see: #59

faustinoaq avatar Aug 08 '17 23:08 faustinoaq

Hi, I think I have the same problem : It's for initialize a environment variable for debug.

Example for launch.json with a SpringBoot application :

{
    "version": "0.2.0",
    "configurations": [

        {
            "type": "java",
            "name": "Debug flash-message",
            "request": "launch",
            "mainClass": "app.Application",
            "args": "",
            "projectName": "flash-message",
            "env": {
                "SPRING_PROFILES_ACTIVE": "dev"
            }
        }
    ]
}

capture du 2017-10-04 00-46-24

ggrebert avatar Oct 03 '17 22:10 ggrebert

Hi @ggrebert I'm using this extension now.

faustinoaq avatar Oct 06 '17 05:10 faustinoaq