Is there any way to set environment variables in Visual Studio Code?

前端 未结 8 1161
眼角桃花
眼角桃花 2020-12-04 17:26

Could you please help me, how to setup environment variables in visual studio code?

相关标签:
8条回答
  • 2020-12-04 18:12

    My response is fairly late. I faced the same problem. I am on Windows 10. This is what I did:

    • Open a new Command prompt (CMD.EXE)
    • Set the environment variables . set myvar1=myvalue1
    • Launch VS Code from that Command prompt by typing code and then press ENTER
    • VS code was launched and it inherited all the custom variables that I had set in the parent CMD window

    Optionally, you can also use the Control Panel -> System properties window to set the variables on a more permanent basis

    Hope this helps.

    0 讨论(0)
  • 2020-12-04 18:12

    As it does not answer your question but searching vm arguments I stumbled on this page and there seem to be no other. So if you want to pass vm arguments its like so

    {
      "version": "0.2.0",
      "configurations": [
        {
          "type": "java",
          "name": "ddtBatch",
          "request": "launch",
          "mainClass": "com.something.MyApplication",
          "projectName": "MyProject",
          "args": "Hello",
          "vmArgs": "-Dspring.config.location=./application.properties"
        }
      ]
    }
    
    0 讨论(0)
提交回复
热议问题