I turned my computer on today to get some work done, started Eclipse and started coding. When I tried to use the command-line though, I got this strange error:
Error: no known VMs. (check for corrupt jvm.cfg file)
I couldn’t run 'java' or 'javac' from the command-line at all! I immediately went to /System/Library/Frameworks/JavaVM.framework and looked for 'jvm.cfg'. I have 3 VMs installed on this machine, 1.3.1, 1.4.2, and 1.5.0. 1.3.1 and 1.4.2 had a proper jvm.cfg file installed but for some reason 1.5.0′s jvm.cfg was a zero-length file. Googling didn’t turn up anything useful except this tip, which wouldn’t work because in my case all my permissions were correct. Fixing permissions using Disk Utility didn’t show any permissions problems at all.
In the end, all I did was copy the 1.4.2 version over to the 1.5.0 directory and all was well. The tip above mentions that Eclipse might have had something to do with this, and there might be some truth to that, as I did update my Eclipse to 3.2 recently, but I have been using it for a week without any problems …
I am actually having this same problem on my Kubuntu box. I’m getting the error with Java 1.5 & Eclipse 3.2. After looking into it, I noticed my jvm.cfg is blank. Finding the jvm.cfg for Java 1.5 is proving difficult; and just reinstalling the packages from scratch didn’t resolve it either. I’m still working with it, but have been googling about it for two days now. I guess I’ll just download the package from Sun and grab the file out of there.