title: Visual Studio Code projectName
body: <p>Using VS Code for Java debugging, there must be <code>projectName</code>defined in the <strong>launch.json</strong> file for using the watch-window while debugging.</p>
  
  <p>How to determine and/or define the name of the Java project? </p>
  
  <p>I always get the error message:</p>
  
  <blockquote>
    <p>Failed to resolve classpath: The project '??' is not a valid java
    project.</p>
  </blockquote>
  
  <p>Here my launch.json extract:</p>
  
  <pre><code>        "type": "java",
          "name": "Debug (Launch)-Application&lt;foo&gt;",
          "request": "launch",
          "cwd": "${workspaceFolder}",
          "console": "internalConsole",
          "stopOnEntry": false,
          "mainClass": "FooClass",
          "args": "",
          "projectName": "??",
          "windows": {
              "classPaths": [
                  "%CLASSPATH%","C:\\JUnit\\junit-4.12.jar", "C:\\JUnit\\hamcrest-junit-2.0.0.0.jar", "."
              ]
           }
  </code></pre>