gpt4 book ai didi

java - 有什么办法可以防止 m2e 修改 eclipse .classpath 文件?

转载 作者:行者123 更新时间:2023-12-04 05:32:56 25 4
gpt4 key购买 nike

我正在将我们的一些项目转换为 Maven 项目,但是 m2e 将我的 .classpath JRE 条目更改为:

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<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.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>

这会导致一些错误,例如:

Description Resource Path Location Type Access restriction: The type WindowsPopupMenuSeparatorUI is not accessible due to restriction on required library C:\Program Files\Java\jdk1.6.0_20\jre\lib\rt.jar DottedJPopupMenuSeparator.java /acommons/src/com/ks/acommons/gui/lookandfeel line 10 Java Problem



有什么办法可以让 m2e 不生成 .classpath 文件,或者强制它使用工作区默认 JDK?

最佳答案

在我看来,Maven 正在帮助你。它强制 Eclipse 使用严格的 Java 1.6 环境并阻止您使用不属于标准发行版的库。

通常,此错误消息暗示您应该声明新的 Maven 依赖项,而不是依赖于(例如)JRE/lib/ext 中存在的 JAR 文件。 .

关于java - 有什么办法可以防止 m2e 修改 eclipse .classpath 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12357380/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com