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

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

问题描述

背景:我正在尝试使用此处.我有 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:

Could not resolve dependencies for project org.apache.hadoop:hadoop-annotations:jar:2.5.0-SNAPSHOT: Could not find artifact jdk.tools:jdk.tools:jar:1.6 at specified path C:\Program Files\Java\jdk-11.0.1\..\lib\tools.jar

我意识到Windows
OpenJDK 11中不存在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 it's 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, or if the updated version also doesn't support Java 11, 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天全站免登陆