In Eclipse select Window > Preferences > Java > Installed JREs.
Click Add.
Browse to the root of the JDK directory (e.g. C:\Program Files\Java\jdk1.5.0_05)
Give the "JRE" a name (e.g. JDK 1.5.0_05)
OK the dialog.
Check the JDK, uncheck the JRE.
OK the dialog.
Your project should automatically switch to using this new JDK. If it does not:
Right click the project directory, select Properties > Java Build Path > Libraries.
Select the JRE System Library, click Edit.
Select Alternate JRE, select the JDK, OK all dialogs.
Click Add.
Browse to the root of the JDK directory (e.g. C:\Program Files\Java\jdk1.5.0_05)
Give the "JRE" a name (e.g. JDK 1.5.0_05)
OK the dialog.
Check the JDK, uncheck the JRE.
OK the dialog.
Your project should automatically switch to using this new JDK. If it does not:
Right click the project directory, select Properties > Java Build Path > Libraries.
Select the JRE System Library, click Edit.
Select Alternate JRE, select the JDK, OK all dialogs.
本文详细介绍了如何在Eclipse中安装并配置Java开发工具包(JDK)的具体步骤。包括选择窗口偏好设置、添加JDK路径、指定JDK名称等操作,并提供了当项目未自动切换到新JDK时的解决方案。
932

被折叠的 条评论
为什么被折叠?



