简体   繁体   English

在10.9上从jdk1.6-> 1.7升级

[英]Upgrading from jdk1.6->1.7 on 10.9

I am running 10.9, which came with 1.7 already installed. 我正在运行10.9,它已经安装了1.7。 Several months ago, I had to downgrade it to 1.6 now am trying to upgrade it back to 1.7 and now have a really messed up install. 几个月前,我不得不将其降级到1.6,现在试图将其升级回1.7,现在安装真的很混乱。 I've installed the official 1.7 installer from Oracle but it doesn't fix the issue, with either maven or or java. 我已经从Oracle安装了官方的1.7安装程序,但是使用maven或java无法解决该问题。 See output below: 请参见下面的输出:

> LM-BWI-00873340:jdk1.7.0_67.jdk user$ mvn -v Error: JAVA_HOME is not
> defined correctly.   We cannot execute /usr/libexec/java_home/bin/java

> LM-BWI-00873340:jdk1.7.0_67.jdk user$ java -v Unrecognized option: -v
> Error: Could not create the Java Virtual Machine. Error: A fatal
> exception has occurred. Program will exit.

I think my sym links are all screwed up, I have followed various guides out there and now have one screwed up installation. 我认为我的符号链接都搞砸了,我遵循了各种指南,现在安装了一个。

EDIT - my bash profile 编辑-我的bash个人资料

LM-BWI-00873340:~ user$ cat .bash_profile
export JAVA_HOME=/usr/libexec/java_home
export PATH=$PATH:${JAVA_HOME}/bin:

需要将以下行添加到.bash_profile中,确保此行位于java_home导出之后

export PATH=$PATH:${JAVA_HOME}/bin:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM