从何处获取 tools.jar 以与 Java 8 jdk 早期版本一起使用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19722058/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where to get the tools.jar to use with the Java 8 jdk early release
提问by The Coordinator
Where to get tools.jar for Java 8 jdk early release? Without it my Java 1.8 Maven pom based projects in Netbeans will not compile.
在哪里可以获得 Java 8 jdk 早期版本的 tools.jar?没有它,我在 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? Can the old tools.jar be used or where did you find it?
有没有人成功地使用 Java 8 早期版本编译基于 Maven pom 的项目?旧的tools.jar 可以用吗或者在哪里找到的?
ANSWER:
回答:
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.
现在是最新版本。
采纳答案by Petesh
The tools.jar
file on the 1.8.0 JDK is located in jdk1.8.0/lib/tools.jar
. If it's not there, then you don't have the JDK installed correctly.
将tools.jar
在1.8.0 JDK文件位于jdk1.8.0/lib/tools.jar
。如果它不存在,那么您没有正确安装 JDK。
回答by itzy
you can download any version of tools.jar file from following site "http://www.java2s.com/Code/Jar/t/Downloadtools160jar.htm"
您可以从以下站点“ http://www.java2s.com/Code/Jar/t/Downloadtools160jar.htm”下载任何版本的tools.jar文件
Note - after download any tools-x.x.jar version , please rename it to tools.jar only & place it to jrex.x/lib folder.
注意 - 下载任何 tools-xxjar 版本后,请将其重命名为 tools.jar 并将其放在 jrex.x/lib 文件夹中。
回答by Etic
I have similar problem, but not after reading this post https://code.google.com/p/android/issues/detail?id=187048. The error only appear when I did not install the JDK on its default directory.
我有类似的问题,但不是在阅读这篇文章https://code.google.com/p/android/issues/detail?id=187048 之后。该错误仅在我未在其默认目录中安装 JDK 时出现。
Install it on default directory resolve the problem.
将其安装在默认目录中即可解决问题。
Hope this will help someone.
希望这会帮助某人。
回答by Praveen Kumar K S
I had the similar problem when I was using Hadoop-Common-2.7.2 as a dependency, When I add exclusions in my POM.xml, my issue got resolved. Hence I would recommend this solution.
当我使用 Hadoop-Common-2.7.2 作为依赖项时,我遇到了类似的问题,当我在 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>
回答by mironq
You just need to install devel package. On RHEL family it's like this:
你只需要安装开发包。在 RHEL 系列上,它是这样的:
# yum install java-1.8.0-openjdk-devel
回答by Sami
Make sure you look into the folder
C:/Program Files/Java/jdk1.8.0_version/lib
instead of
C:/Program Files (x86)/Java/jdk1.8.0_version/lib
确保您查看文件夹
C:/Program Files/Java/jdk1.8.0_version/lib
而不是
C:/Program Files (x86)/Java/jdk1.8.0_version/lib
回答by Akshay Vijay Jain
I was facing issue compiling maven project, error being, not able to find tools.jar in lib folder, when i looked at Eclipse>Window>preference>Java>Installed JRE> it was pointing to JRE, which seems obvious, but when I changed the pointing to JDK
我在编译 maven 项目时遇到了问题,错误是,无法在 lib 文件夹中找到 tools.jar,当我查看 Eclipse>Window>preference>Java>Installed JRE> 它指向 JRE,这似乎很明显,但是当我改变指向JDK
Compile error was resolved, since there is tools.jar in JDK
编译错误已解决,因为JDK中有tools.jar
before this I tried copying tools.jar from jdk/lib to jre/lib, but that did not solve the issue
在此之前,我尝试将 tools.jar 从 jdk/lib 复制到 jre/lib,但这并没有解决问题
回答by Fahad
Solution that worked for me simply, copy the tools.jar from your jdk\lib folder and paste into jre\lib folder. Hope that will work.
对我来说很简单的解决方案,从 jdk\lib 文件夹中复制 tools.jar 并粘贴到 jre\lib 文件夹中。希望这会奏效。
回答by Sam-T
The solution is to update the eclpise.ini, If no JDK is used for Eclipse, change it:
Quit Eclipse if it is running
Go to the Eclipse installation directory and open the file eclipse.ini in a text editor.
Search for the line -vmargs
Before the line -vmargs, add two lines:
On the first line, write -vm
On the second line, write the path to your JDK installation (usually something like: C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe on Windows)*
解决方法是更新eclpise.ini,如果Eclipse没有使用JDK,则更改它:
如果Eclipse正在运行,请退出Eclipse
转到Eclipse安装目录并在文本编辑器中打开文件eclipse.ini。
搜索 -vmargs 行
在 -vmargs行之前,添加两行:
在第一行,写 -vm
在第二行,写你的 JDK 安装路径(通常类似于:C:\Program Files\Java\jdk1 .6.0_31\bin\javaw.exe 在 Windows)*
回答by Gayan Weerakutti
Some JDK packages contain just the Java Runtime Environment.
一些 JDK 包只包含 Java 运行时环境。
So for instance in Fedora, Oracle Linux, RHEL, CentOSjava-1.8.0-openjdk
package contains just the JRE. If you want the development tools, then install the java-1.8.0-openjdk-devel
package instead.
例如在Fedora、Oracle Linux、RHEL、CentOSjava-1.8.0-openjdk
包中只包含 JRE。如果您需要开发工具,请安装该java-1.8.0-openjdk-devel
软件包。
And in Debian/Ubuntuopenjdk-8-jre
package contains just the JRE. If you want the development tools, then install the openjdk-8-jdk
package instead.
在Debian/Ubuntuopenjdk-8-jre
包中只包含 JRE。如果您需要开发工具,请安装该openjdk-8-jdk
软件包。