简体   繁体   中英

Upgrading from jdk1.6->1.7 on 10.9

I am running 10.9, which came with 1.7 already installed. 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. I've installed the official 1.7 installer from Oracle but it doesn't fix the issue, with either maven or or 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

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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