Can anyone please tell me why I get the following error when I try to run my Java programs? The programs get compiled successfully but are not able to be run. I have already set the path of Java.
Error: could not open C:\Program Files\Java\jre6\lib\amd64\jvm.cfg
this should be an internal file of JRE and in general you shouldn't deal with it when you're running/compiling java.
Here you can find an explanation of what exactly this file is intended for. Bottom line, your Java installation is somehow corrupted, so as a first resort to resolve this issue, I suggest you to re-install jre.
You should ensure that you're installing the right jre for your architecture.
Hope, this helps