简体   繁体   English

Eclipse-刚卸载了Java 1.7(我的机器上仍然有Java 1.6),但是现在Eclipse无法识别任何Java东西

[英]Eclipse - Just uninstalled Java 1.7 (still have Java 1.6 on my machine), but now Eclipse won't recognize any java stuff

I'm extremely confused about how to set up Java on Eclipse. 我对如何在Eclipse上设置Java感到非常困惑。 I don't get how classpath/system variables/etc all works. 我不知道类路径/系统变量/等等如何工作。 I set my Java compiler settings from 1.7 to 1.6 after I uninstalled 1.7 (I still have 1.6). 卸载1.7(我仍然有1.6)后,我将Java编译器设置从1.7设置为1.6。 But it's still not working. 但是它仍然无法正常工作。 Any help? 有什么帮助吗?

Open Eclipse. 打开Eclipse。 Follow Project => Properties => Java Build Path . 跟随Project => Properties => Java Build Path

Come onto Libraries tab and on the right hand side you will see some buttons, click Add Library . 进入“ 库”标签,在右侧,您会看到一些按钮,点击添加库

Select JRE System Library and click "Next" button. 选择JRE系统库 ,然后单击“下一步”按钮。 By clicking on Installed JREs button you will see the JREs that your Eclipse recognizes. 通过单击Installed JREs按钮,您将看到Eclipse可以识别的JRE。 If the JRE version is not visible there, you can use "Add" button to add a new JRE, and make sure you set the path of new JRE correctly. 如果在此处看不到JRE版本,则可以使用“添加”按钮添加新的JRE,并确保正确设置新JRE的路径。 Sample path on my machine: C:\\Program Files (x86)\\Java\\jre6 我的计算机上的示例路径: C:\\ Program Files(x86)\\ Java \\ jre6

可能您必须设置类路径: http : //javarevisited.blogspot.com/2011/01/how-classpath-work-in-java.html ,或者您只有JRE(没有JDK)吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM