# Problem with installing Java: java: command not found

I just installed Java 8.25 but I'm still not getting 'legacy' applications to work. I tried verifying the version in terminal:

manfred$java --version -bash: java: command not found  I think there's a conflict between two versions or something perhaps. How can I solve this? • How did you install Java? – mmmmmm Jan 5 '15 at 22:30 • @Mark the .dmg with installer. – Mike Jan 6 '15 at 10:51 • which dmg? Oracles JRE, or JDK etc – mmmmmm Jan 6 '15 at 11:00 • @Mark First I did the Oracle JRE 8.25 and then the JDK 8.25... – Mike Jan 6 '15 at 11:01 • As per my answer here Oracles's OS X JRE does not install /usr/bin/java. I would reinstall the JDK and check what is in /usr/bin – mmmmmm Jan 6 '15 at 11:21 ## 1 Answer Looks like Java is not in the path. I do something like this in my ~/.bash_profile # Get Java Home for the specific version JAVA_HOME=/usr/libexec/java_home -v1.8 2>/dev/null # Add Java to the path export PATH=$JAVA_HOME/bin:\$PATH


Quit terminal once you create or edit ~/.bash_profile. FYI if you are creating ~/.bash_profile make sure you give it executable privileges.

• ~/.bash_profile does not need executable privileges – mmmmmm Jan 10 '15 at 18:38
• Interesting all these years I have been making sure my bash start up scripts have execute privilege. Good to know that is not needed. – Scott Walter Jan 10 '15 at 18:48