VSCode部署JAVA项目出现The type java.lang.Object cannot be resolved
如题,出现的原因是这样的:我将mac系统上的eclipse项目复制到了ubuntu环境下,通过vscode的远程功能连接ubuntu。
然后项目上就出现了各种报错,显示The type java.lang.Object cannot be resolved。
查明原因是两个系统的jdk不一致,所以生成的项目配置不一样。
查看.classpath文件,它是用于配置jdk版本的。
原来是这样:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12"/>
修改后是这样:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
然后重启vs code就没有报错了。
注意不要直接复制我的,具体修改成怎样,看你jdk的版本,可以试试在vscode生成一个新的项目,看看.classpath是怎么配置的。
出现这个问题的原因有很多:
类似jdk或jre没有指定;可以尝试vscode clean the java language server workspace。
VSCode部署JAVA项目出现The type java.lang.Object cannot be resolved的更多相关文章
- 部署hibernate框架项目时出现问题:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files.
基本情况: (这些其实关系不大)我是直接impor导入HibernateDemo项目到eclipse中的,该项目的hibernate版本是3.6.7.Final版,使用了Hibernate Tools ...
- The type java.lang.Object cannot be resolved
有时候在Eclipse中打开或者导入项目时会出现标题字样的问题:The type java.lang.Object cannot be resolved. It is indirectly refer ...
- 解决本机安装多版本jdk导致The type java.lang.Object cannot be resolved It is indirectly referenced ...
本机开始安装了jdk1.6,然后安装了jdk1.8 当在调自动化的时候,发现传入函数传参String类型,报错The type java.lang.Object cannot be resolved ...
- eclipse中java文件报错:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
问题:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class fi ...
- 【典型错误】The type java.lang.Object cannot be resolved.
参考:http://blog.csdn.net/wo519074786/article/details/7697967 The type java.lang.Object cannot be reso ...
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
The type java.lang.Object cannot be resolved.It is indirectly referenced from required .class files ...
- 杂(三)-The type java.lang.Object cannot be resolved It is indirectly referenced ...
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files ...
- Java MyEclipse:The type java.lang.CharSequence cannot be resolved. It is indirectly referen
从svn上下载项目后配置weblogic后启动报错: myeclipse The type java.lang.CharSequence cannot be resolved. It is indi ...
- java项目的心得,java项目的代码层次的架构划分
java项目使用的架构是ssm(Spring+SpringMVC+MyBatis). 一.后台代码一般分三层,Controller,Service,Dao. 1.Controller层是对前端或者接口 ...
随机推荐
- GitHub新手教学(从新手安装到初步使用)
版权声明:本文为博主原创文章,转载请标明出处! 博客地址:http://blog.csdn.net/qazwsxpcm https://blog.csdn.net/qazwsxpcm/article/ ...
- Html / XHtml 解析 - Parsing Html and XHtml
Html / XHtml 解析 - Parsing Html and XHtml HTMLParser 模块 通过 HTMLParser 模块来解析 html 文件通常的做法是, 建立一个 HTMLP ...
- pytorch之 bulid_nn_with_2_method
import torch import torch.nn.functional as F # replace following class code with an easy sequential ...
- Linux高级系统恢复技术
一,MBR毁坏: 查看系统分区在那: 毁坏MBR: 如果没有重启动,可以直接恢复: 如果重启之后就不可启动系统,需要恢复系统: 出现这样的情况: force off关机,使用光盘启动,添加一个镜像光盘 ...
- Flutter Widgets 之 InkWell 和 Ink
注意:无特殊说明,Flutter版本及Dart版本如下: Flutter版本: 1.12.13+hotfix.5 Dart版本: 2.7.0 InkWell InkWell组件在用户点击时出现&quo ...
- 远程服务器返回错误:(414)Request-URI Too Large
近期因为疫情原因,一直是在家办公了,也导致了和同事对接接口上出现了很多小问题,这也从侧面反映出我个人对项目的设计不全面. 上面是对接接口时产生的一个问题:远程服务器返回错误:(414)Request- ...
- Android.mk文件LOCAL_SDK_VERSION选项
Api分类 internal api 翻译为内部API,理解为供sdk内部使用的API. 这类接口最初打算就是不对外公开的,有点private的意思. hide api 在源码中看到使用@hide 标 ...
- Android Studio 快捷方式记录
- Leetcode字典树-720:词典中最长的单词
第一次做leetcode的题目,虽然做的是水题,但是菜鸟太菜,刚刚入门,这里记录一些基本的知识点.大佬看见请直接路过. https://leetcode-cn.com/problems/longest ...
- 定时器_在.net core3.0 webapi中添加自定义定时器功能
前言:想在.net framework环境使用自定义定时器的话,参考我的另一篇文章:https://www.cnblogs.com/lxhbky/p/10242839.html 想在.net core ...