如何在 Windows 上获取 OpenJDK 11 的 tools.jar? [英] How to get tools.jar for OpenJDK 11 on Windows?

查看:34
本文介绍了如何在 Windows 上获取 OpenJDK 11 的 tools.jar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:我正在尝试使用 此处的说明为 Windows 构建 Hadoop.我有 OpenJDK 11 并且在运行 mvn package 时遇到了以下问题:

Background: I am trying to build Hadoop for Windows using instructions found here. I have OpenJDK 11 and have ran into the following issue while running mvn package:

无法解析项目 org.apache.hadoop:hadoop-annotations:jar:2.5.0-SNAPSHOT: 找不到工件 jdk.tools:jdk.tools:jar:1.6 在指定路径 C:Program FilesJavajdk-11.0.1..lib ools.jar

我意识到 OpenJDK 11 的 Windows 构建中不存在 tools.jar.我是否也必须从源代码构建它?如何获取 OpenJDK 11 的 tools.jar Maven 人工制品?

I realised no tools.jar exists in the Windows build of OpenJDK 11. Would I have to build this from source as well? How can I get the tools.jar Maven artefact for OpenJDK 11?

推荐答案

它已在 JDK 9 中删除.

It was removed in JDK 9.

JEP 220 删除了众所周知且经常引用的 JAR rt.jar 和 tools.jar.根据其描述,以前存储在 lib/rt.jar、lib/tools.jar、lib/dt.jar 和其他各种内部 jar 文件中的类和资源文件现在将在实现中以更高效的格式存储-lib 目录中的特定文件.

JEP 220 removed the well-known and frequently-referenced JARs rt.jar and tools.jar. According to its description, "The class and resource files previously stored in lib/rt.jar, lib/tools.jar, lib/dt.jar, and various other internal jar files will now be stored in a more efficient format in implementation-specific files in the lib directory.

我建议您使用更新版本的 Apache Hadoop.如果更新的版本也不支持 Java 11,请将您的 Java 降级到 1.8.

I suggest you use a updated version of Apache Hadoop. If the updated version doesn't support Java 11 either, downgrade your Java to 1.8.

比如目前Apache Hadoop稳定版本是2.9.2,在安装说明中特意引用了JDK 9之前的JDK,建议大家使用OpenJDK 1.8

For example, the current stable Apache Hadoop is version 2.9.2, and in its instructions on how to install, it specifically references JDKs before JDK 9. For its proper support, I suggest you use OpenJDK 1.8

有一个 Hadoop 3.1.1,如果您发现 Java 版本对您的成功至关重要,我会研究一下.

There is a Hadoop 3.1.1, and if you find the Java version is critical to your success, I'd look into that.

这篇关于如何在 Windows 上获取 OpenJDK 11 的 tools.jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆