[英]Where to get the tools.jar to use with the Java 8 jdk early release
Where to get tools.jar for Java 8 JDK early release?在哪里可以获得 Java 8 JDK 早期版本的 tools.jar? Without it, my Java 1.8 Maven pom based projects in Netbeans will not compile.没有它,我在 Netbeans 中基于 Java 1.8 Maven pom 的项目将无法编译。
The Java 8 early release is set in the Java Platforms setting and all the Java 8 projects that are not Maven-based will compile and run. Java 8 早期版本在 Java 平台设置中设置,所有非基于 Maven 的 Java 8 项目都将编译和运行。
https://jdk8.java.net/download.html https://jdk8.java.net/download.html
It is not found on the downloads page, I can not find anything in their search.在下载页面上找不到它,我在他们的搜索中找不到任何东西。
Does anyone have success compiling Maven pom based projects with the Java 8 early release?有没有人成功地使用 Java 8 早期版本编译基于 Maven pom 的项目?
Can the old tools.jar
be used or where did you find it?旧的tools.jar
可以用吗或者在哪里找到的?
The tools.jar
file on the 1.8.0 JDK is located in jdk1.8.0/lib/tools.jar
. 1.8.0 JDK 上的tools.jar
文件位于jdk1.8.0/lib/tools.jar
。 If it's not there, then you don't have the JDK installed correctly.如果它不存在,那么您没有正确安装 JDK。
Please see the accepted answer - the tools.jar
file was omitted in a specific early access revision ( jdk-8-ea-bin-b106-windows-i586-05_sep_2013.exe
).请参阅已接受的答案 - 在特定的早期访问版本 ( jdk-8-ea-bin-b106-windows-i586-05_sep_2013.exe
) 中省略了tools.jar
文件。
You just need to install devel package.你只需要安装开发包。 On RHEL family it's like this:在 RHEL 系列上,它是这样的:
# yum install java-1.8.0-openjdk-devel
I had a similar problem when using Hadoop-Common-2.7.2 as a dependency.使用 Hadoop-Common-2.7.2 作为依赖项时,我遇到了类似的问题。 I resolved the problem by adding the following exclusions to my POM.xml
file:我通过向POM.xml
文件添加以下排除项解决了该问题:
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.2</version>
<exclusions>
<exclusion>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
</exclusions>
</dependency>
You can download any version of the tools.jar
file.您可以下载任何版本的tools.jar
文件。 For example, it is available from java2s.com .例如,它可以从java2s.com 获得。 It would be preferable, though, to find it on the official Oracle site, if possible.不过,如果可能的话,最好在 Oracle 官方网站上找到它。
After downloading any version of the tools-xxjar
file, simply rename it to tools.jar
(removing the version number) and place it in the jrex.x/lib
folder.下载任何版本的tools-xxjar
文件后,只需将其重命名为tools.jar
(去掉版本号)并将其放在jrex.x/lib
文件夹中。
I had a similar problem and found the solution in the Android Public Issue Tracker: tools.jar not packed in lib of Java JDK 8 and Android studio gives tools.jar missing error .我遇到了类似的问题,并在 Android Public Issue Tracker 中找到了解决方案: tools.jar notpacked in lib of Java JDK 8 and Android studio给出了 tools.jar missing error 。
As kn...@gmail.com states in comment #8 , the error appears only when the JDK is not installed in its default directory.正如 kn...@gmail.com 在评论 #8 中所述,仅当 JDK 未安装在其默认目录中时才会出现该错误。 The problem is resolved by reinstalling the JDK into its default directory.通过将 JDK 重新安装到其默认目录中可以解决该问题。
确保查看文件夹C:/Program Files/Java/jdk1.8.0_version/lib
而不是C:/Program Files (x86)/Java/jdk1.8.0_version/lib
Some JDK packages contain just the Java Runtime Environment.一些 JDK 包只包含 Java 运行时环境。
So for instance in Fedora, Oracle Linux, RHEL, CentOS java-1.8.0-openjdk
package contains just the JRE.例如在Fedora、Oracle Linux、RHEL、CentOS java-1.8.0-openjdk
包中只包含 JRE。 If you want the development tools, then install the java-1.8.0-openjdk-devel
package instead.如果您需要开发工具,请安装java-1.8.0-openjdk-devel
包。
And in Debian/Ubuntu openjdk-8-jre
package contains just the JRE.在Debian/Ubuntu openjdk-8-jre
包中只包含 JRE。 If you want the development tools, then install the openjdk-8-jdk
package instead.如果您需要开发工具,请安装openjdk-8-jdk
包。
Answer on the behalf of question author:代表问题作者回答:
This version is missing
tools.jar
:jdk-8-ea-bin-b106-windows-i586-05_sep_2013.exe
这个版本缺少tools.jar
:jdk-8-ea-bin-b106-windows-i586-05_sep_2013.exe
It is now in the most recent release.现在是最新版本。
When I looked at Eclipse > Window > preference > Java > Installed JRE >
, it was pointing to JRE
, which seems obvious.当我查看Eclipse > Window > preference > Java > Installed JRE >
,它指向JRE
,这似乎很明显。 However, when I changed it to point to JDK
, the compile error was resolved.但是,当我将其更改为指向JDK
,编译错误已解决。 This is because there is tools.jar
in the JDK
folder.这是因为JDK
文件夹中有tools.jar
。
Before this, I had tried copying tools.jar
from jdk/lib
to jre/lib
.在此之前,我曾尝试将tools.jar
从jdk/lib
复制到jre/lib
。 However, that did not solve the issue.然而,这并没有解决问题。
只需从jdk\\lib
文件夹中复制tools.jar
并粘贴到jre\\lib
文件夹中。
The solution is to update the eclipse.ini
file.解决方法是更新eclipse.ini
文件。 If no JDK is used for Eclipse, change it:如果 Eclipse 没有使用 JDK,请更改它:
eclipse.ini
in a text editor进入 Eclipse 安装目录,在文本编辑器中打开文件eclipse.ini
-vmargs
搜索行-vmargs
-vmargs
, add two lines:在-vmargs
行-vmargs
,添加两行:
-vm
第一行写-vm
C:\\Program Files\\Java\\jdk1.6.0_31\\bin\\javaw.exe
on Windows)*在第二行,写下 JDK 安装的路径(通常类似于: C:\\Program Files\\Java\\jdk1.6.0_31\\bin\\javaw.exe
在 Windows 上)*文件tools.jar
在 Java 9 中被删除。请在此处查看Oracle.com JDK 9 页面上的“删除的工具和组件”
If using Reactive Native:如果使用反应式原生:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.