Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Dec 8 '12 at 21:57

This question came from our site for professional and enthusiast programmers.

    
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 '12 at 17:15

1 Answer 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
share|improve this answer
    
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 '12 at 17:42
    
ln -s <real_file> <link_file>. –  Marko Topolnik Dec 8 '12 at 18:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.