The objective of this post talk about my little “adventure” in resolving the fatal Java error that prohibits running Java application.
Symptoms
You use to have the Java applications and Java IDE on your Windows-based system working then one fine day, out of unknown reason, all the Java application and plug-in in the IDE cease to work. Worse, no error message and the application just silently fail to run. Oh, your first thought is that this shouldn’t happen because it is not even April’s fool day or Monday’s blue because today is Wednesday in July. So your first reaction is to re-install the Java SDK or runtime assuming that they might have been damaged. However just before re-installing you confirm that the SDK/runtime is indeed the main problem so you test-run some command in Window command console. jar.exe command run fine but running java.exe on directory other it’s bin directory produce the infamous
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
What so damaging about this problem is the some plugins like Android and Grails in Intellij become non-functional as well. You know why very soon.
So here I go trying to resolve the issue. Running Java.exe produce error in other directories (since the SDK’s bin is added to path.)
However running in it’s bin directory, it runs fine.
Investigation
So your immediate conclusion is that somehow the path is the main culprit. However looking at the path output, there is nothing very harmful on the path after all it is just windows path and the JavaFX path which should hardly cause any problem since it is the “buddy” of Java, it should play well.
Still the investigation continue and use a “divide and conquer” approach. Next you reset the path to using only the Java’s bin directory by using:
path=c:\devsys\java\lib\sdk16\bin
and voila, the problem goes away now !
Now the last thing to do is to check which directory on the path is causing the problem. So the main surprise turn out that Windows directory is the major culprit.
Still curious on how Windows directory can be the source of problem, the only way such error can happen is that the same file (java.exe) might have existed in Windows and overshadowing the one in Java’SDK hence causing the problem. Remember that when a file is executed, the one in foremost directory on the path will be run.
Results
The good news is that it is nothing supernatural or magical but the bad news is that the Windows directory is the “protagonist” . From file search, it can be concluded that somehow certain mischievous program is copying some crucial java files into Windows directory which are stored in path, and so unless the java’s bin is the foremost in the path, one will bound to get the error. The error occurs because Java.exe or other Java executable expect some support files and directories to be found but obviously could not find it in Windows directory. Running the java.exe in its bin directory will not produce error because Windows will use the current directory to which the file is run first before searching for it in the path.
Removing those java files in the Windows cure the problem. However, the next step is to find out the application that copy those files which will surely be more challenging and adventurous than this.
So what is exactly very frustration about this path issue is that it result in very-hard-to-find problem that could result in very expensive effort. For example, one will re-reinstall Java’s SDK ample times and yet the problem persists simply because of file overshadowing. That to say any directory in the path could be the victim not just Windows’.
So here end the “adventure” and hope anyone reading this can learn through this experience .
THANK YOU!
I just ran into the same error message but have no SDKs installed. It was just various versions of Java conflicting with themselves. http://blog.revragnarok.com/blog/blog/Java
Oh yeah, BTW, the “standard” JVM install from Java.com is what was likely putting the executables in the Windows folder.
genial
thanks
Oh thanks a lot.
But still i do have one doubt ..If we are removing the java.exe files from the windows folder. will it give any problems in the future scenarios.
Thank you very much, it resolve my problem 🙂
It works well for me. I just deleted java.exe in Windows/Systes32 directory. Then, java works fine.
thanks,
Thank you also man i did what you did and it worked thank-you soooo much.
Thanks a lot. After looking at so many useless threads, I finally came across your page and that helped me to solve the issue.
Thank you very much, it resolve my problem 🙂
Awesome buddy… it does not just works. it rocks….
Thanks! Saved me more headache. Had to remove all of the executables you had listed there.
Thanks you saved me lot of time.
Thank you so much! I was stucked with the JVM problem for almost half a day, and yr blog helps me! 😀
We run into same issue with our “Citrix License Management Console” server (errors in \Tomcat\logs jakarta_service logs – Error occurred during initialization of VM / java/lang/NoClassDefFoundError / java/lang/Object) but in our case we had 3 java files missing from \Java\jre6\lib rt.jar, jsse.jar and font.properties.ja. After copying those files from another JRE U22 installation all is working fine.
Thanks a lot.
Excellent. It also did it for me and saved me a lot of time since I did not have to track the problem down.
Thanks again for sharing this tip.
Cheers
thanks. back to work
Man, seriously i was unable to figure this out, and it was really killing me from few days..
I am very very very thankful to you……
Hatsoff bro..
Thanks….
All I had to do was put the Java path before the windows system32 path.
older versions of java copied those files to the windows dir, not sure about version 6, but it’s just as likely perhaps it does as well
http://java.sun.com/j2se/1.5.0/runtime_windows.html
“By default, the installer places a copy of the runtime environment in the C:\Program Files\Java\jre1.5.0 directory. In addition, if no more recent version is already installed on the machine, the installer puts copies of the java and javaw application-launcher executables in the Microsoft Windows system directory. (The system directory varies depending on the Microsoft Windows version, but is usually either C:\winnt\system32 or C:\windows\system.)”
Thanks, helped a lot – what a mess ;(
Its good. Really worked for me.
Thank you, This post has saved me numerous hours and hair puuling.
This fine Monday morning I came in and logged on my PC to find out that Eclipse just crashes without pop up. Setting eclipse argument solved my problem. I found out java.exe in system32 directory placed last week. At this point I am not sure what application placed that file. So I just decided to address my Eclipse problem
Thank you again.
Best. Post. Ever.
Thanks buddy….this really helped me in need..
Thanks a lot.. but i am not knowing the reason for this… 😦
Thanks a lot! Do you use jEdit? It seems that it might have something to do with the problem.
thanks, it’s work
inspect your java installation from ControlPanel=>ProgramAndFeatures and confirm just 1 installation of java exist in your computer.
If there are 2 installation or more exist in your computer you must uninstall them and let just 1 installation java exist in your computer.
thnx a lot. me also just deleted java.exe(c:\windows\system32) and now my java is properly running. thank u very much
That saved me many hours of wasted time… Cheers!
Wonderful write-up! Should come up first in search for this kind of error. Thanks! Wonder why windows includes Java.exe!
Thank you! You saved me eons of time.
Checking time/date stamps, I believe the culprit was Pidgin.
Can anyone confirm this?
Awesome tips!! Did exactly what you advised and am up and running. Thanks a ton!!
thanks alot! it solved my problem too!
ORACLE Java automatic update, copies java.exe to “C:\WINDOWS\system32” windows directory (I’m using XP).
Move the “%JAVA_HOME%\bin;” in first place (most to the left) into the PATH variable and the problem is solved, even if java.exe is not deleted from windows directory.
Thank you! It saved me a lot of hours of frustration
Thank you very much!!!!
Thanks a lot!!!
Its very useful when i encountered the same problem with my Eclipse setup. Thanks a lot.
Your tips are very useful when i encountered the same problem with my Eclipse setup. Thanks a lot.
Thank you… How the hell java arrived in the System32 directory!
Great tip. Thanks.
Great tip. Thanks a bunch.