How to get tools.jar for OpenJDK 11 on Windows?

痴心易碎 提交于 2019-12-30 06:06:07

问题


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

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?


回答1:


It was removed in JDK 9.

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.

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.

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

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



来源:https://stackoverflow.com/questions/53707666/how-to-get-tools-jar-for-openjdk-11-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!