title: How to avoid VS Code warning: "[myfile].java is a non-project file, only syntax errors are reported"
body: <p>I am running a build task in a java project in Visual Studio Code.
  The warning in the &quot;PROBLEMS&quot; tab:</p>
  <blockquote>
  <p>[myfile].java is a non-project file, only syntax errors are reported</p>
  </blockquote>
  <p>It refers to the first line where I load in the class file containing the main():</p>
  <pre><code>package [the project folder];
  import [the project folder].[the file with other classes].*;
  </code></pre>
  <ul>
  <li>I can only avoid the warning by copying the files' text (the code text itself) into new java files of a new project in a new unrelated folder. The code itself is correct and compiles without errors. Actually, this is the answer, but it is much manual work.</li>
  <li>When I just copy the java files of the project with the warning message into a new folder, the warning still appears!!!! (!)</li>
  <li>When I just copy the whole project folder to a new place, the error remains as well, of course.</li>
  </ul>
  <p>I guess that copying text into new java files with the same names and the same folder structure is different from copying the files themselves because the files probably get tagged by VS Code, so that they have a project stamp even when the folder structure is destroyed. Perhaps this supports recovering the project structure from recovered raw files? Could this be the problem of this Visual Code warning?</p>
  <p>I checked other threads before, this is just the last step.</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/50454523/how-can-i-fix-build-failed-do-you-want-to-continue-in-vscode/55916509#comment109352218_55916509">How can I fix build failed, do you want to continue? in vscode</a></li>
  <li><a href="https://stackoverflow.com/questions/45743779/visual-studio-code-java-import-errors-and-more/61825498#61825498">Visual Studio Code - Java - Import Errors and More</a></li>
  </ul>
  <p>--&gt; Thus, I cleaned vscode's workspaceStorage (on Windows: <code>C:\Users\USER\AppData\Roaming\Code\User\workspaceStorage</code>) and restarted without success.</p>