eclipse创建springboot项目没有buildpath以及java和maven依赖解决

问题:
通过eclipse创建springboot项目后发现缺少maven和java的依赖文件
在这里插入图片描述
百度解决办法是 再build path下添加,结果发现项目连buildpath也没有

解决问题:
1.找回build path
在项目的properties中点击Project Facets 点击蓝色链接进入勾选java选项然后应用。然后reflash下
2.没有maven依赖
我没有maven依赖是因为项目中缺少.classPath文件。直接从其它项目中复制一个就行 内容不变 内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
	<attributes>
		<attribute name="optional" value="true"/>
		<attribute name="maven.pomderived" value="true"/>
	</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
	<attributes>
		<attribute name="maven.pomderived" value="true"/>
	</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
	<attributes>
		<attribute name="test" value="true"/>
		<attribute name="optional" value="true"/>
		<attribute name="maven.pomderived" value="true"/>
	</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
	<attributes>
		<attribute name="maven.pomderived" value="true"/>
	</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
	<attributes>
		<attribute name="maven.pomderived" value="true"/>
	</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

然后刷新下
3没有java依赖
properties-》java build path-》点击 jre system libray 选择自己下载的jdk版本

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值