eclipse导入maven项目报错"Missing artifact com.sun.:tools:jar:1.8.0"错误解决方法
maven
Maven: Apache Maven是一个开源的项目管理和构建工具,主要用于Java项目。适合需要自动化项目构建和依赖管理的开发者。特点包括约定优于配置、易于使用和社区驱动。
项目地址:https://gitcode.com/gh_mirrors/ma/maven
·
一、报错信息
1.1分析原因
选中项目-->右键 -->"Properties"-->"Java Build Path"

二、解决步骤
在报错的pom.xml文件中添加:
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.8.0_144</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
或
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.8.0_144</version>
<scope>system</scope>
<systemPath>C:/Program Files/Java/jdk1.8.0_144/lib/tools.jar</systemPath>
</dependency>
注意:
1. 斜杠都使用“/”
2. C:/Program Files/Java/jdk1.8.0_144 要按照您实际路径修改该值。
Maven: Apache Maven是一个开源的项目管理和构建工具,主要用于Java项目。适合需要自动化项目构建和依赖管理的开发者。特点包括约定优于配置、易于使用和社区驱动。
最近提交(Master分支:27 天前 )
9a5fb675
* Initial plan
* Add missing deprecated constants to MavenCli for backward compatibility
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
* Add missing extension model classes for backward compatibility
- Created org.apache.maven.cli.internal.extension.model package
- Added CoreExtension and CoreExtensions classes (deprecated)
- Updated ExtensionResolutionException to return old model type
- Added overloaded constructor for compatibility with new API
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
* Add missing xpp3 reader/writer
* Do not add @Deprecated on constants since the class already is
* Add two other missing constants
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com> 15 小时前
ae103fb7
Bumps `xmlunitVersion` from 2.10.4 to 2.11.0.
Updates `org.xmlunit:xmlunit-core` from 2.10.4 to 2.11.0
- [Release notes](https://github.com/xmlunit/xmlunit/releases)
- [Changelog](https://github.com/xmlunit/xmlunit/blob/main/RELEASE_NOTES.md)
- [Commits](https://github.com/xmlunit/xmlunit/compare/v2.10.4...v2.11.0)
Updates `org.xmlunit:xmlunit-matchers` from 2.10.4 to 2.11.0
- [Release notes](https://github.com/xmlunit/xmlunit/releases)
- [Changelog](https://github.com/xmlunit/xmlunit/blob/main/RELEASE_NOTES.md)
- [Commits](https://github.com/xmlunit/xmlunit/compare/v2.10.4...v2.11.0)
---
updated-dependencies:
- dependency-name: org.xmlunit:xmlunit-core
dependency-version: 2.11.0
dependency-type: direct:production
update-type: version-update:semver-minor
- dependency-name: org.xmlunit:xmlunit-matchers
dependency-version: 2.11.0
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 15 小时前
新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。
更多推荐



所有评论(0)