0

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?

5
  • How did you install Java?
    – mmmmmm
    Commented Jan 5, 2015 at 22:30
  • @Mark the .dmg with installer.
    – Mike
    Commented Jan 6, 2015 at 10:51
  • which dmg? Oracles JRE, or JDK etc
    – mmmmmm
    Commented Jan 6, 2015 at 11:00
  • @Mark First I did the Oracle JRE 8.25 and then the JDK 8.25...
    – Mike
    Commented Jan 6, 2015 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
    Commented Jan 6, 2015 at 11:21

1 Answer 1

1

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.

2
  • 1
    ~/.bash_profile does not need executable privileges
    – mmmmmm
    Commented Jan 10, 2015 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. Commented Jan 10, 2015 at 18:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .