简体   繁体   中英

Mac OSX. Java 7 or 1.7, which is the current version?

I am trying to run an application (on MacOSX) that relies on Java. Docs are telling me that I need to update from Java 1.6 to 1.7. I then found, downloaded and installed java 7 from Java.com, but I'm still getting java version error when running app. when I enter 'java -version' into terminal it tells me I am still running 1.6?

I'm sure there is a logical explanation for this, but at the moment I feel Like I am in the twilight zone. What is the current version, 1.7 or 7? Why is it that in System Preferences it says I have Java 7 installed, but 'java -version' says I have 1.6?

Help!

I just have this in my bash profile:

export JAVA_HOME=$(/usr/libexec/java_home)

... This should ensure that your Mac references Java 7 where applicable. Per the Apple docs:

The /usr/libexec/java_home tool dynamically finds the top Java version specified in Java Preferences for the current user. This path allows access to the bin subdirectory where command line tools such as java, javac, etc. exist as on other platforms. The tool /usr/libexec/java_home allows you to specify a particular CPU architecture and Java platform version when locating a $JAVA_HOME.

(From Technical Q&A QA1170: Important Java Directories on Mac OS X )

EDIT re bash profiles: If you don't know about shells and their configuration, you have a little work ahead ofyou. However, Nathaniel Landau's post, My Mac OSX bash profile may well help you.

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