Setting JDK in Eclipse

前端 未结 6 1372
旧时难觅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:54

    To tell eclipse to use JDK, you have to follow the below steps.

    1. Select the Window menu and then Select Preferences. You can see a dialog box.
    2. Then select Java ---> Installed JRE’s
    3. Then click Add and select Standard VM then click Next
    4. In the JRE home, navigate to the folder you’ve installed the JDK (For example, in my system my JDK was in C:\Program Files\Java\jdk1.8.0_181\ )
    5. Now click on Finish.

    After completing the above steps, you are done now and eclipse will start using the selected JDK for compilation.

提交回复
热议问题