The most eclipse free and easy way to switch the JDK version of a project back and forth

Source: Internet
Author: User

Original: 72847110

Requirements background: Sometimes the local eclipse runs a project that uses a higher (low) version of the JDK than the Linux server and requires a low (high) JDK version.

Here's an example where I switched the JDK version from 1.7 to 1.6:

All the settings that need to be set in Eclipse are set in two parts:

Part One: Set the JDK version of the Eclipse workspace, which is the compilation run environment for all projects in eclipse

1.window-preferences-java-compiler-right panel set to 1.6

2.window-preferences-java-installed jres-right Panel "ADD" local 1.6 version of the JDK path, and tick

Go on...

Part Two: Set the JDK version of the project you want to change JDK

3. Right-click Project (typically Cms-core sub-project instead of CMS-CMS project)-properties (or Project right-click-build path-configure Build path)-java build path (right panel)- libraries-(if there is a JRE System Library [JavaSE-1.7] on the right side of the "Edit ..." change to local jdk1.6, if it is a different JDK point "Remove"-add library...-Select "JRE System Library "-next-to local jdk1.6)-then make sure that the tab on the right side of the libraries" Order and Export "also appears in the JRE System library [JavaSE-1.6]

4. The Java compiler-Right panel on the same page as the Java Build path is set to 1.6

5. On the right panel of project facets-with Java compiler page, Java,version set to 1.6

Important NOTE: Some students originally the project is good or the new guide down the project, after the completion of the JDK project is wrong, the project package name has a small red fork, but is not found the file error, at this time you have to see whether your project right-click-build Path Settings page has no error, Also want to see your JDK version of these steps are set to, less one step your project may error appear small red fork and will not appear in the specific file on the small red fork, even if your project can run, as if the operation is not a problem, until the deployment to the server real version problems appear, may not find the direction.

The most eclipse free and easy way to switch the JDK version of a project back and forth

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.