How is the Eclipse JDK setting affecting the system's JDK setting

前端 未结 1 1072
说谎
说谎 2020-12-11 11:51

I was trying to compile a Grails application referencing third party JARs on Mac OSX. Although my system\'s JRE and JDK is set to Java 1.6 I always got a Compilation e

相关标签:
1条回答
  • 2020-12-11 12:38

    The JDK (JAVA_HOME) used to launched eclipse is not necessarily the one used to compiled your project.

    To see what JRE YOU y can select for your project, check the preferences

    General > Java Installed JRE
    

    By default, if you have not added any JRE, the only one declared will be the one used to launched eclipse (which can be defined in your eclipse.ini).
    You can add any other JRE you want, including one compatible with your project.

    http://help.eclipse.org/juno/topic/org.eclipse.jdt.doc.user/tasks/images/task-add_jre_std_vm.PNG

    After that, you will need to check in your project properties (or in the general preferences) what JRE is used, with what compliance level:

    http://www.standartux.fr/public/Java/Preferences.png

    0 讨论(0)
提交回复
热议问题