« August 2005 | Main

September 09, 2005

"jarError: no known VMs. (check for corrupt jvm.cfg file)"

I had this weird error suddenly appear after using Eclipse and changing various compiler settings and moving the default JRE used by Eclipse. The error was:

% java 
jarError: no known VMs. (check for corrupt jvm.cfg file)
Every java command returned this same error. After some google work, I finally realized it was an issue with permissions.

I am not sure how, who, what, but someone or something changed permissions on the jvm.cfg file to only be readable as root; thus, only root could run java command. Not surprise that

% sudo java
works without complaint. To fix this, you need to change permissions on jvm.cfg. As usual, finding this file is a pain and go figure, spotlight is useless. Here is what you need to do:
% sudo chmod a+r /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib
Everything should work fine now. An alternative path to this file is:
/Library/Java/Home/lib/ 
Good luck.

Posted by egm at 02:51 PM | Comments (0)