问题
Eclipse keeps giving me the above error when trying to run my test class. JDK is properly installed and I've never gotten an error like this with other IDEs.
回答1:
Also make sure it's correctly configured under :
Window > preferences > Java > Installed JREs
回答2:
It is necessary that you indicate the location of the jre. You must go to Window / Preferences, and then
- Java / Installed JREs: to indicate the location of JREs (you delete the old one and you add the new folder (jdk or jre)
OR
- Java / Installed JREs / Execution Environments: To associate and JRE runtime environment (JavaSE #your-version) - have to get out and return the preference to confirm the new location.
回答3:
Set it in your build path, right click project > properties > build path
来源:https://stackoverflow.com/questions/29693969/eclipse-error-unable-to-locate-executable-for-jre7