java - MacOS JDK path. Where is it? -
this question has answer here:
i started using macos , think ide not finding proper jdk path. here's i've done.
initially when got mac installed jdk apple's website (i thought work if got version). seemed worked until tried importing project eclipse , said jdk 7 requires (the version apple version 6).
i downloaded jdk 8 oracle , installed. know after step having this. not sure new install located (for whatever reason, when program installs doesn't show sort of directory have no idea went).
searching "jdk" install directory have found:
it's not in applications (which makes sense, that's else goes have installed).
i tried searching macintosh hd , don't see (i feel went wrong here because why wouldn't work?). macintosh hd closest-to-root directory on macos?
to find current home of jdk on macos, type in terminal:
/usr/libexec/java_home
on machine, yields:
/library/java/javavirtualmachines/jdk1.8.0_40.jdk/contents/home
but note version different, run command, don't copy-paste result.
to find existing jdks, including previous versions:
/usr/libexec/java_home -v
on machine yields:
1.8.0_40, x86_64: "java se 8" /library/java/javavirtualmachines/jdk1.8.0_40.jdk/contents/home 1.7.0_71, x86_64: "java se 7" /library/java/javavirtualmachines/jdk1.7.0_71.jdk/contents/home 1.7.0_67, x86_64: "java se 7" /library/java/javavirtualmachines/jdk1.7.0_67.jdk/contents/home
now, make sure eclipse sees @ least 1 of these. open preferences:

if jre not appear there, add it. if does, go project's build path , make sure appears there well. in project→properties, supposed see:

Comments
Post a Comment