1

I'm in dire straights. I was trying to replace my java JDK and downgrade to 1.6 and somehow managed to completely screw up all the previous versions in the process. Bottom line, my Mac has no JDK installed at all.

I've tried reinstalling java 1.7 from Oracle, I've tried using Pacifist to manually extract the files from the 1.6 Apple Java... nothing.

When I open terminal and use java -version all I get is

-bash: java: command not found

My real goal is just to get back to java 1.7, but even after running the installer, java is still inaccessible to terminal and other applications.

1
  • IMHO, this question really doesn't have much to do with programming but rather installing a software (that software being a programming environment). I think this is a better fit for SuperUser
    – posdef
    Dec 8, 2012 at 17:15

1 Answer 1

1

Don't panic, you're going to handle it one way or another. This is the directory where Java 7 installs itself:

/Library/Java/JavaVirtualMachines

Check it out. If Java is there, you just need to add some symbolic links or even add the whole Java bin directory to the system path. Normally this is not necessary, but you won't destroy anything even if you do it that way.

The normal location where java is found by system path lookup is

/usr/bin/java

but it is only a symbolic link to

/Library/Java/Home/bin/java
2
  • Ok, the JDK and JVM are definitely in /Library/Java/JavaVirtualMachines but how do I connect it to the alias in /usr/bin ?
    – Stuartsoft
    Dec 8, 2012 at 17:42
  • ln -s <real_file> <link_file>.
    – Marko Topolnik
    Dec 8, 2012 at 18:31

You must log in to answer this question.

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