首页 > 解决方案 > Vs Code java The import cannot be resolved

问题描述

I recently moved from windows 10 to Ubuntu 16.04, I'm a java developer, when I was on windows I installed Vs Code with the java Extension pack. On windows I never Had problem to make my daily work, but on ubuntu, every java file is marked as error, with the message "The import cannot be resolved", searching a litle bit, i found that you can execute the command java:clean the java language server workspace, but this does not fix the problem. I also remove the tmp files from the workspace located on:

~/.config/Code/User/workspaceStorage

Any ideas?.

Regards!.

Edit: all my java files are marked as error

inside of every java file

this is the result of the maven-install

标签: javaspringubuntuvisual-studio-code

解决方案


好吧,经过一段时间的搜索,我发现“maven for java”插件正在尝试下载 maven 插件maven-metadata.xml,这在我的仓库中不可用。这导致与 maven for java 正在执行的初始构建发生冲突。为了避免每次打开 vs 代码时都更新,我删除了“更新快照”选项

VSCode 配置截图

并且初始构建完成。


推荐阅读