vs code - Expected java package name error

后端 未结 4 1553
名媛妹妹
名媛妹妹 2021-01-17 20:05

I have a java project with the following directory structure (as required by Gradle\'s \'java\' plugin, assuming all defaults).

projectRootDir
          


        
4条回答
  •  忘掉有多难
    2021-01-17 20:50

    Because vscode set the src folder as the default Java Source Path, you should change it to folder src/main/java. Just right click the folder src/main/java in vscode and click the option Add Folder to Java Source Path, then reopen the file, and the error is gone.

提交回复
热议问题