Not able to properly set up the path of java in Wi

2019-03-28 05:40发布

问题:

I have installed java 1.6 in my computer and I have also set the path, using the advanced variable settings.

At a command prompt when I tried to execute java I got this error:

 Error: could not open `C:\Program Files\Java\jre7\lib\amd64\jvm.cfg'

But when I executed this command from a command prompt: javac -version it was showing that I had the proper version set.

 javac 1.6.0_27.

Someone please help me to solve this error.

回答1:

Windows 7

  1. Go to the control panel, "Control Panel\All Control Panel Items"
  2. Then find java icon, click on it.
  3. Select option "Java" right next to the "General" tab.
  4. There is only one button in this box "View", click on this.
  5. Look up your corresponding JRE vesion and make sure it is pointing to the correct version, under path.
  6. If your JRE is not visible click ADD.


回答2:

I got this same error when I removed java 7 from my windows 7 laptop and then tried to startup eclipse. You must have java 7 installed at some time as well or you wouldn't have gotten this error.

Deleting the folders wasn't enough. I had to remove it using the control panels uninstall feature, whereas with older versions of java you just deleted the folder where java was installed. In any event, it worked again after I uninstalled it.