2

In my Java application, Visual Studio Code throws the following error for all my non-java imports:

package this.is.a.package does not exist (compiler.err.doesnt.exist)

This error appeared a few days ago. Before that my projects and imports where working just fine. I tried to reinstall VSC several times, rebooted my Mac and deleted all files in $HOME/Library/Application Support/Code/User/workspaceStorage/ as suggested by this feed (Visual Studio Code - Java - Import Errors and More). The Java application compiles just fine in IntelliJ IDEA. Therefore, the file structure should be correct.

The error appears after the installation of the Java Language Support (https://marketplace.visualstudio.com/items?itemName=georgewfraser.vscode-javac) extension.

Julian
  • 181
  • 10

3 Answers3

1

Eventually I solved this issue by deleting the content of the settings.json file and replace it with some standard entries.

{
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "files.autoSave": "afterDelay",
    "java.semanticHighlighting.enabled": true,
    "java.jdt.ls.vmargs": "",
    "java.import.gradle.jvmArguments": ""
}
Julian
  • 181
  • 10
1

I had the same issue and finally after uninstalling the Java Language Support the problem was resolved. Thank you!

Sami
  • 11
  • 2
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 23 '22 at 11:58
-1

maybe, you can try the "Java Extension Pack" extension in the marketplace. as the 'Language Support for Java(TM) by Red Hat' under the pack can provide you the ability of compile.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13