现在无法在Win7上运行Java并且无法执行安装程序

时间:2017-05-06 02:04:11

标签: java eclipse windows-7-x64

我在Win7机器上安装了Eclipse Neon.3。我用JDK 1.8.0_102运行它。

出于某种原因,我试图从Oracle站点安装JDK 1.8.0_131(而不是JRE),但是在点击"是"之后似乎什么也没做。在"你想要执行"对话框。

我决定放弃它,但现在我甚至无法使用最初的102 JDK。当我尝试运行Eclipse时,它似乎忽略了我启动它的请求。

在DOS shell中,我执行" java -version"它给了我这个:

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

请注意,这是一个JRE,而不是JDK。

在同一个shell中,这是PATH的开头:

Path=C:\ProgramData\Oracle\Java\javapath;c:\Program Files\Java\jdk1.8.0_102\bin;

那" javapath"没有被我放在那里。

当我查看该目录时,它看起来像这样:

Directory of c:\ProgramData\Oracle\Java\javapath

05/05/2017  06:50 PM    <DIR>          .
05/05/2017  06:50 PM    <DIR>          ..
05/05/2017  06:50 PM    <SYMLINK>      java.exe [C:\Program Files\Java\jre1.8.0_
131\bin\java.exe]
05/05/2017  06:50 PM    <SYMLINK>      javaw.exe [C:\Program Files\Java\jre1.8.0
_131\bin\javaw.exe]
05/05/2017  06:50 PM    <SYMLINK>      javaws.exe [C:\Program Files\Java\jre1.8.
0_131\bin\javaws.exe]

我跑了&#34; regedit&#34;并看到HKEY_LOCAL_MACHINE \ SOFTWARE \ JavaSoft \ Java Runtime Environment \ 1.8具有以下内容: * JavaHome:C:\ Program Files \ Java \ jre1.8.0_131 * RuntimeLib:C:\ Program Files \ Java \ jre1.8.0_131 \ bin \ server \ jvm.dll

我似乎无法让这个再次起作用。我甚至尝试下载并运行102 JDK安装程序,它和131安装程序做的一样,它似乎忽略了我启动它的请求。

更新

好吧,关于设置JAVA_HOME正确排序的评论引导我一些善意,但不一定是因为你所说的。我很清楚JAVA_HOME需要指向JDK这一事实。但是,我确实认为要验证我设置的内容,并且我看到它指的是102安装。那应该没问题,但是因为那个奇怪的&#34; javapath&#34;指向131安装的东西,我决定尝试将JAVA_HOME设置为131安装。

然后我重新启动了Eclipse,它出现了,但经过一些检查后,我发现它仍然存在。

我在“问题”视图中看到错误,例如&#34;缺少工件com.sun:tools:jar:0&#34;和#34;容器&#39; Maven Dependencies&#39;引用非现有库&#39; C:\ Users \ .m2 \ repository \ com \ sun \ tools \ 0 \ tools-0.jar&#39;&#34;。这肯定指向使用JRE而不是JDK运行Eclipse。

然后我又去了一个DOS shell并打印了JAVA_HOME的值:

JAVA_HOME=c:\Program Files\Java\jdk1.8.0_131

然后我运行了visualvm,打开了Eclipse进程并查看了系统属性,在那里我看到了一些令人困惑的信息(其中一些缩短了):

applicationXMI=org.eclipse.ui.workbench/LegacyIDE.e4xmi
awt.toolkit=sun.awt.windows.WToolkit
eclipse.application=org.eclipse.ui.ide.workbench
eclipse.buildId=4.6.3.M20170301-0400
eclipse.commands=-os
win32
-ws
win32
-arch
x86_64
-showsplash
-launcher
C:\Users\<me>\eclipse\java-neon2\eclipse\eclipse.exe
-name
Eclipse
--launcher.library
C:\Users\<me>\.p2\pool\plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.401.v20161122-1740\eclipse_1617.dll
-startup
C:\Users\<me>\eclipse\java-neon2\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
--launcher.appendVmargs
-vm C:/Program Files/Java/jdk1.8.0_131
-product
org.eclipse.epp.package.java.product
-vm
C:\Program Files\Java\jre1.8.0_131\bin\server\jvm.dll

eclipse.home.location=file:/C:/Users/<me>/eclipse/java-neon2/eclipse/
eclipse.launcher=C:\Users\<me>\eclipse\java-neon2\eclipse\eclipse.exe
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=file:/C:/Users/<me>/.p2/
eclipse.p2.max.threads=10
eclipse.p2.profile=C__Users_<me>_eclipse_java-neon2_eclipse
eclipse.product=org.eclipse.epp.package.java.product
eclipse.startTime=1494036816583
eclipse.stateSaveDelayInterval=30000
eclipse.vm=C:\Program Files\Java\jre1.8.0_131\bin\server\jvm.dll
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx3072m
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
-Djava.class.path=C:\Users\<me>\eclipse\java-neon2\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar

equinox.init.uuid=true
equinox.use.ds=true
file.encoding=Cp1252
file.encoding.pkg=sun.io
file.separator=\
gosh.args=--nointeractive
guice.disable.misplaced.annotation.check=true
http.nonProxyHosts=dets-codereview.bodc.att.com|scm.it.att.com|localhost|127.0.0.1
http.proxyHost=one.proxy.att.com
http.proxyPort=8080
http.proxySet=true
https.nonProxyHosts=dets-codereview.bodc.att.com|scm.it.att.com|localhost|127.0.0.1
https.proxyHost=one.proxy.att.com
https.proxyPort=8080
https.proxySet=true
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.awt.printerjob=sun.awt.windows.WPrinterJob
java.class.path=C:\Users\<me>\eclipse\java-neon2\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
java.class.version=52.0
java.endorsed.dirs=C:\Program Files\Java\jre1.8.0_131\lib\endorsed
java.ext.dirs=C:\Program Files\Java\jre1.8.0_131\lib\ext;C:\Windows\Sun\Java\lib\ext
java.home=C:\Program Files\Java\jre1.8.0_131
java.io.tmpdir=C:\Users\<me>\AppData\Local\Temp\
java.library.path=C:\Users\<me>\eclipse\java-neon2\eclipse;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;c:\Program Files\Java\jdk1.8.0_131\bin;C:\Program Files (x86)\RSA SecurID Token Common;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;c:\Program Files\Java\jdk1.8.0_131\bin;C:\Program Files\nodejs\;c:\Users\<me>\frameworks\gradle-3.5\bin;c:\Users\<me>\frameworks\apache-groovy-sdk-2.4.7\groovy-2.4.7\bin;C:\Program Files\Git\cmd;C:\Program Files\Oracle\VirtualBox;C:\Program Files (x86)\Calibre2\;C:\Program Files (x86)\Prince\engine\bin;C:\Program Files\1E\NomadBranch\;C:\Users\<me>\frameworks\jd-gui-windows-1.4.0\;C:\Program Files (x86)\Enterprise Vault\EVClient\;C:\Users\<me>\sysinternals\TcpView;C:\Users\<me>\AppData\Roaming\npm;C:\Users\<me>\Desktop;;.
java.rmi.server.randomIDs=true
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.8.0_131-b11
java.specification.name=Java Platform API Specification
java.specification.vendor=Oracle Corporation
java.specification.version=1.8
java.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
java.version=1.8.0_131
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=1.8
java.vm.vendor=Oracle Corporation
java.vm.version=25.131-b11
jnidispatch.path=C:\Users\<me>\AppData\Local\Temp\jna--1331751731\jna4323154665511181061.dll
line.separator=\r\n
oomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
oomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
org.eclipse.debug.ui.breakpoints.toggleFactoriesUsed=true
org.eclipse.equinox.launcher.splash.location=C:\Users\<me>\.p2\pool\plugins\org.eclipse.platform_4.6.3.v20170301-0400\splash.bmp
org.eclipse.equinox.simpleconfigurator.configUrl=file:org.eclipse.equinox.simpleconfigurator/bundles.info
org.eclipse.m2e.log.dir=C:\Users\<me>\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration
org.eclipse.swt.internal.deviceZoom=100
org.eclipse.update.reconcile=false
org.osgi.framework.executionenvironment=OSGi/Minimum-1.0,OSGi/Minimum-1.1,OSGi/Minimum-1.2,JavaSE/compact1-1.8,JavaSE/compact2-1.8,JavaSE/compact3-1.8,JRE-1.1,J2SE-1.2,J2SE-1.3,J2SE-1.4,J2SE-1.5,JavaSE-1.6,JavaSE-1.7,JavaSE-1.8
org.osgi.framework.language=en
org.osgi.framework.os.name=Windows7
org.osgi.framework.os.version=6.1.0
org.osgi.framework.processor=x86-64
org.osgi.framework.system.capabilities=osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0, 1.1, 1.2",osgi.ee; osgi.ee="JRE"; version:List="1.0, 1.1",osgi.ee; osgi.ee="JavaSE"; version:List="1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8",osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8",osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8",osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8"
org.osgi.framework.system.packages=javax.accessibility,...
org.osgi.framework.uuid=83c1b397-2bd8-4102-916b-3d2d6f782fc3
org.osgi.framework.vendor=Eclipse
org.osgi.framework.version=1.8.0
org.osgi.supports.framework.extension=true
org.osgi.supports.framework.fragment=true
org.osgi.supports.framework.requirebundle=true
os.arch=amd64
os.name=Windows 7
os.version=6.1
osgi.arch=x86_64
osgi.bundles=reference:file:org.eclipse.osgi.compatibility.state_1.0.200.v20160504-1419.jar,reference:file:org.eclipse.wst.jsdt.nashorn.extension_1.0.2.v201610280128.jar,reference:file:org.eclipse.equinox.simpleconfigurator_1.1.200.v20160504-1450.jar@1:start
osgi.bundles.defaultStartLevel=4
osgi.compatibility.bootdelegation=true
osgi.compatibility.bootdelegation.default=true
osgi.configuration.area=file:/C:/Users/<me>/eclipse/java-neon2/eclipse/configuration/
osgi.framework=file:/C:/Users/<me>/.p2/pool/plugins/org.eclipse.osgi_3.11.3.v20170209-1843.jar
osgi.framework.extensions=reference:file:org.eclipse.osgi.compatibility.state_1.0.200.v20160504-1419.jar,reference:file:org.eclipse.wst.jsdt.nashorn.extension_1.0.2.v201610280128.jar
osgi.framework.shape=jar
osgi.framework.useSystemProperties=true
osgi.frameworkClassPath=., file:C:/Users/<me>/.p2/pool/plugins/org.eclipse.osgi.compatibility.state_1.0.200.v20160504-1419.jar, file:C:/Users/<me>/.p2/pool/plugins/org.eclipse.wst.jsdt.nashorn.extension_1.0.2.v201610280128.jar
osgi.install.area=file:/C:/Users/<me>/eclipse/java-neon2/eclipse/
osgi.instance.area=file:/C:/Users/<me>/workspace/
osgi.instance.area.default=file:/C:/Users/<me>/workspace/
osgi.logfile=C:\Users\<me>\workspace\.metadata\.log
osgi.nl=en_US
osgi.os=win32
osgi.requiredJavaVersion=1.8
osgi.splashLocation=C:\Users\<me>\.p2\pool\plugins\org.eclipse.platform_4.6.3.v20170301-0400\splash.bmp
osgi.splashPath=file:/C:/Users/<me>/.p2/pool/plugins/org.eclipse.platform_4.6.3.v20170301-0400
osgi.syspath=c:\Users\<me>\.p2\pool\plugins
osgi.tracefile=C:\Users\<me>\workspace\.metadata\trace.log
osgi.user.area=file:/C:/Users/<me>/user/
osgi.ws=win32
path.separator=;
sun.arch.data.model=64
sun.boot.class.path=C:\Program Files\Java\jre1.8.0_131\lib\resources.jar;C:\Program Files\Java\jre1.8.0_131\lib\rt.jar;C:\Program Files\Java\jre1.8.0_131\lib\sunrsasign.jar;C:\Program Files\Java\jre1.8.0_131\lib\jsse.jar;C:\Program Files\Java\jre1.8.0_131\lib\jce.jar;C:\Program Files\Java\jre1.8.0_131\lib\charsets.jar;C:\Program Files\Java\jre1.8.0_131\lib\jfr.jar;C:\Program Files\Java\jre1.8.0_131\classes
sun.boot.library.path=C:\Program Files\Java\jre1.8.0_131\bin
sun.cpu.endian=little
sun.cpu.isalist=amd64
sun.desktop=windows
sun.io.unicode.encoding=UnicodeLittle
sun.jnu.encoding=Cp1252
sun.management.compiler=HotSpot 64-Bit Tiered Compilers
sun.os.patch.level=Service Pack 1
svnkit.http.methods=Basic
svnkit.library.gnome-keyring.enabled=false
user.country=US
user.dir=C:\Users\<me>\Desktop
user.home=C:\Users\<me>
user.language=en
user.name=<me>
user.script=
user.timezone=America/Los_Angeles
user.variant=

在这里,您将看到对JDK和JRE的引用,即使在&#34; eclipse.commands&#34;中,其大部分值来自我的&#34; eclipse.ini&#34;文件,只有一个&#34; -vm&#34;参数,指的是131 JDK(不是JRE)。

有趣的是,我根本不了解它是如何成功安装131 JDK的,因为当我执行该安装程序时,我点击了&#34;是&#34;用于运行安装程序的按钮,但它从未启动其他对话框。似乎它在后台完成了所有这些。

更新

卸载131 JDK并重新安装它似乎是一个好主意。不幸的是,它似乎没有结果。卸载并重新安装后,&#34; java -version&#34;的结果没有改变,我仍然得到关于失踪&#34;工具的错误&#34; Eclipse中的工件,visualvm似乎仍然认为我使用的是JRE,而不是JDK。

奇怪的是,&#34; javapath&#34;目录现在不同了。而不是符号链接,他们现在是&#34;硬文件&#34;同名。

更新

我刚尝试卸载131和102的JDK和JRE,然后运行102 JDK安装程序。我设置了#34; -vm&#34; eclipse.ini文件中的参数指向102安装。我将JAVA_HOME设置为102分配。我重新启动了Eclipse。完全相同的错误。然后我检查了&#34; javapath&#34;目录再次,现在他们再次符号链接,指向JRE可执行文件,而不是JDK可执行文件。我还重申了visualvm并验证了&#34; java.home&#34; Eclipse进程中的属性是JRE,而不是JDK。

我迷惑了。

0 个答案:

没有答案