Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Unable to locate a Java Runtime to invoke?

Hi guys,

I have a quite new MacBook Pro (just a couple of moths old) and it has a problem with Java.

When I try to open some java applications I get a system message box telling me this: "Cannot launch 'Program xxx' No compatible version of Java 1.5 is available."

I have updated to the recent java provided from apple and even tired to re-install it once.

If I try to access the Utilities/Java Prefrences.app it throws quite the same message as trying to run any other java app: "Cannot launch 'Java Prefrences' No compatible version of Java 1.5+ is available."

I've run some terminal commands and the tell there is a problem with the system finding the java runtime environment. Some terminal commands and their outputs:

$ java -version
Unable to locate a Java Runtime to invoke.

$ /usr/libexec/java_home --verbose
Unable to find any JVMs matching version "(null)".
Matching Java Virtual Machines (0):
Default Java Virtual Machines (0):
Unable to find any system-provided Java.

$ ls -al /System/Library/Java/JavaVirtualMachines
total 0
drwxr-xr-x 3 root wheel 102 9 Maa 15:33 .
drwxr-xr-x 6 root wheel 204 9 Maa 15:33 ..
drwxr-xr-x 3 root wheel 102 1 Maa 01:52 1.6.0.jdk

$ ls -al /Library/Java/JavaVirtualMachines
total 0
drwxrwxr-x 3 root admin 102 23 Hel 21:11 .
drwxrwxr-x 5 root admin 170 9 Maa 15:33 ..
drwxrwxr-x 3 root admin 102 1 Maa 01:48 1.6.0_24-b07-334.jdk

$ echo $JAVA_HOME
Returns nothing.

I'd really appreciate if any of you guys could help me. I've done what I can.

MacBook Pro 2.4GHz Intel Core i5, Mac OS X (10.6.6), Wireless Aluminium Keyboard + Mighty Mouse + 27" Fujitsu external display

Posted on Mar 10, 2011 3:05 AM

Reply
Question marked as Best reply

Posted on Mar 10, 2011 4:56 AM

same problem here after installing the new java update:
"Java Developer Package for Mac OS X 10.6 Update 4 (Disk Image) 133.4 MB 07 Mar 2011"
21 replies

Mar 10, 2011 2:11 PM in response to sarukuku

Same problem. Cannot launch "altitude" - No compatible version of Java 1.5+ is available.

There's then an option to Open Java Preferences and that comes back with a similar error message:
Cannot launch "Java Preferences" - No compatible version of Java 1.5+ is available.

Seems that there may be a method to roll back to an earlier version that works:
http://www.insanelymac.com/forum/index.php?showtopic=183447

Message was edited by: Tristan Lips

Mar 11, 2011 5:34 AM in response to sarukuku

Hi guys!

Good news is that I maged to fix this problem.
Bad news: It's not that "easy" as I'd wish.

If you follow the instruction below it's up to you. I guarantee nothing but it fixed my problem and I didn't even had to restore any information from a backup I made because the installer didn't remove any of my files but updated / re-installed all the system files.

So, what did I do?

1. Backup everything.
2. Insert the system disk that came with your computer and start the installer from the desktop to re-install the system. Before doing this make sure the disk contains the same system you are running already. Example: you have SL installed and the disk that came with your computer has some version of SL. OK!
3. Update the system via Software update when it has been re-installed.
4. The problem is gone!

You can try if the problem is gone by trying to launch the Java Preferences.app or typing java in terminal.

Hope this helps someone!

Message was edited by: sarukuku

May 28, 2012 1:48 PM in response to sarukuku

The fix didn't work for me..


I'm running lion and before the fix it gave me the error "no compatible version of java 1.5+"

But java preferences did work, only it would not save my preferences. So when it turned java on and close the preferences next time i opened the preferences it would be off again.

So i decided to do the pacifist fix, but now nothing works anymore also not the java preferences.


*thinking of the good old snow leopard days...and windows

May 28, 2012 2:57 PM in response to lightbubbl.es

Hey Lightbubbl.es


It seems like you've forced a Snow Leopard hack into a Lion system which was a bad idea because Lion and Snow Leopard are worlds apart!!


What you should try is running this package normally... http://support.apple.com/kb/DL1515


And if it doesn't work then try running the package above using the Pacifist hack. The package should be the same but it's a lion specific version. It also should replace the snow leopard files you have added to your system (in theory). I can't really test this as my lion isn't having this problem ;)


Good Luck

Unable to locate a Java Runtime to invoke?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.