Use different JDK version Project Settings in eclipse

Source: Internet
Author: User

The title is a bit difficult to write... haha, because I don't know how to write it, I'm afraid it's too long. Let's take a look...

I will explain it first, that is, when eclipse continuously releases new versions, it also requires the required JDK versions. For example, I am running JDK 1.6.
Elicpse
3.3.1.1... but at this time, eclipse will default a JRE as the JRE of the newly created Project... that is to say, in my environment, the newly created Project will be selected by default.
Jdk1.6 is used as the Java runtime/compilation environment... the setting is in Windows> preferences> JAVA>
Under installed jres... you can add your own JRE by clicking the "add..." button. The selected item is the default JRE of the project...

In this case, if I have a project that requires support from JDK and does not support the version, how can I develop, compile, and debug it in eclipse of JDK? The main point is to talk about the steps I have taken to solve this problem: (Suppose the project has been created)

1. Project-> properties-> JAVA build path

There are two JRE here. I have added one. This is required. If it is not added, there must be only one jre1.6.0, but it is not required by the Project 1, so I want
Add jdk1.4.2. (JRE/JDK is always mentioned here. It is the same in this place. That is to say, you can specify both the JRE directory you installed and the JDK directory )...

1. Click Add library...

2. Next>

3. Click installed jres... and click Add on the right.

4. Click Browse... to go to your j2se installation directory... As mentioned earlier, the JDK and JRE directory are selected here...

5. After confirmation, eclipse will automatically name this JRE...

6. OK... then go back to step 2... You can select jdk1.4.2.

7. Finish, and then delete jre1.6.0 from the Java build path attribute...
On the properties configuration page, go to Java compiler and configure the compiler... Check enable project specific.
Settings, set the level of compiler compliance to 1.4, and click OK.

So the configuration is complete... as for the JRE on Tomcat side, I also suggest using 1.6.0, because the JRE speed of 1.6 has been significantly improved...

So good luck...

ZZ: http://enjoylog.cn/archives/different-jdk-between-project-settings-and-eclipse.html

 

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.