Setting JDK in Eclipse

前端 未结 6 1397
旧时难觅i
旧时难觅i 2020-11-22 16:37

I have two JDKs, for Java 6 and 7.

I want to build my project using both. Initially we only built against 1.6. I see in my project setting I can select 1.5, 1.6 1.7

6条回答
  •  忘掉有多难
    2020-11-22 16:43

    Some additional steps may be needed to set both the project and default workspace JRE correctly, as MayoMan mentioned. Here is the complete sequence in Eclipse Luna:

    • Right click your project > properties
    • Select “Java Build Path” on left, then “JRE System Library”, click Edit…
    • Select "Workspace Default JRE"
    • Click "Installed JREs"
    • If you see JRE you want in the list select it (selecting a JDK is OK too)
    • If not, click Search…, navigate to Computer > Windows C: > Program Files > Java, then click OK
    • Now you should see all installed JREs, select the one you want
    • Click OK/Finish a million times

    Easy.... not.

提交回复
热议问题