在OSX上重新安装Java 7 JDK [英] Reinstalling Java 7 JDK on OSX

查看:113
本文介绍了在OSX上重新安装Java 7 JDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在OSX 10.7.5(Lion)上安装Java 7(aka 1.7).

I've tried to install Java 7 (aka 1.7) on OSX 10.7.5 (Lion).

不幸的是,这似乎已经把Java混在一起了,我不确定如何解决该问题.当前,当我尝试运行Eclipse时,出现错误:

Unfortunately this seems to have mucked up Java all together and I'm not sure how to resolve the problem. Currently when I try to run Eclipse I get the error:

JVM共享库"/System/Library/Frameworks/JavaVM.framework"不包含JNI_CreateJavaVM符号.

The JVM shared library "/System/Library/Frameworks/JavaVM.framework" does not contain the JNI_CreateJavaVM symbol.

Minecraft和PhpStorm之类的程序将完全崩溃,没有错误.

Programs such as Minecraft and PhpStorm will crash completely with no errors.

在终端中运行'java -version'给我:

Running 'java -version' in terminal gives me:

java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

我理解可以直接安装Java7.不幸的是,实用程序-> Java首选项已在OSX 10.7.5中删除,并且尝试加载系统首选项-> Java窗格不起作用(它告诉我它会在新窗口中打开,但不会出现,当按钮显示要重新加载它时,单击它不会执行任何操作.

Which I understand is to be expected with a straight install of Java 7. Unfortunately Utilities -> Java Preferences has been removed in OSX 10.7.5, and trying to load the System Preference -> Java pane doesn't work (it tells me that it opens in a new window but doesn't, when the button appears to reload it, clicking it doesn't do anything).

我尝试重新安装各种版本的JRE和JDK无济于事.

I've tried reinstalling various versions of JRE and JDK to no avail.

反正还有很多东西可以重新开始,还是我错过了一些明显的东西?

Is there anyway to bin the lot and start again or am I missing something really obvious?

推荐答案

查找Mac OS X上Java 7的安装目录所在的位置.将JAVA_HOME shell变量设置为该目录(目录必须包含binlib子目录).将路径编辑为export PATH="${JAVA_HOME}/bin:${PATH}".尝试再次运行java -version.

Find out where the installation directory of your Java 7 is on your Mac OS X. Set the JAVA_HOME shell variable to that directory (directory must contain a bin and lib subdirectory). Edit the path to export PATH="${JAVA_HOME}/bin:${PATH}". Try running java -version again.

如果所有其他方法都失败了,那么也许您必须重新安装操作系统才能恢复Mac Java的默认设置,而只需重新安装Java 7.

If all else fails, then perhaps you will have to reinstall your OS in order to bring back Mac Java defaults and just reinstall Java 7.

我在Mountain Lion(10.8)上遇到了类似的问题:安装Java 7 SDK之后,我删除了Apple默认的Java 6 JRE.这弄乱了我的计算机,尤其是Eclipse.该问题与以下事实有关:Apple向Mac OS X提供了官方的Java JRE,直到Java 7出现并且Oracle成为该版本的官方供应商.重新安装操作系统后,我能够获得提示窗口,询问我有关下载Java运行时的信息.这将重新安装Apple Java 6 JRE.

I had this similar problem on Mountain Lion (10.8): after installing the Java 7 SDK, I deleted the Apple-default Java 6 JRE. This messed up my computer, especially Eclipse. The issue is related to the fact that Apple delivered the official Java JRE to Mac OS X, until Java 7 came out and Oracle became the official supplier for that version. After I reinstalled the OS, I was able to get the prompt window that asked me about downloading a Java runtime. This will reinstall the Apple Java 6 JRE.

这篇关于在OSX上重新安装Java 7 JDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆