java - 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
the current Version of Vs code is 1.41.1
the current version of Java Extension Pack is 0.8.1
Any ideas?.
Regards!.
解决方案
好吧,经过一段时间的搜索,我发现“maven for java”插件正在尝试下载 maven 插件maven-metadata.xml
,这在我的仓库中不可用。这导致与 maven for java 正在执行的初始构建发生冲突。为了避免每次打开 vs 代码时都更新,我删除了“更新快照”选项
并且初始构建完成。
推荐阅读
- python - Python 3:如何将函数添加到库的 Python 类中?
- sql - 如何设计用于存储库存商店中项目的数据库?
- android - 使用自定义对话框类时如何修改文本并单击侦听器?
- java - 无法使用 Java 编辑 XSL 属性值
- amazon-web-services - 如何触发服务器的侦听器
- assembly - 当内核开发者想写汇编时,他们是写高层次的,然后用编译器转换,还是直接写汇编?
- django - 从 `views.py` 在 django 中动态创建模型
- python - 在 Python 中访问外部函数和类
- tomcat - Nginx 提供静态中断页面但不显示图像 - 他们 502
- node.js - 通过猫鼬模式传递硬编码值