Distinguish between two JRE in eclipse

Source: Internet
Author: User
Tags ini

Today, a Cownewstudio user asked me via QQ that his eclipse installation Cownewstudio later see Studio in Eclipse, but when it runs, it prompts for class loading errors. Because the current version of Cownewstudio only supports JDK5, I asked him if Eclipse uses a 1.4 JRE, but he confirms that it uses 1.5.

Later, after experimenting, I confirmed that the JRE version of the problem, he took his eclipse screenshot to me to prove that he used JDK1.5, but I found he sent over the picture Engineering compiler Configuration dialog box. Haha, I finally understand, let him send Eclipse configuration details ("Help" = "About Eclipse" "configuration Details"), and sure enough:

-vm

C:\programe\jdk1.4.2\jre\bin\javaw.exe

It turns out that he installed multiple versions of the JDK. I want him to copy the JRE directory under the JDK1.5 directory to the Eclipse installation directory, and then restart Eclipse, and everything is working fine.

This is a common mistake that many developers who have just come in contact with Eclipse, even for a long time, are confusing the JRE with the Eclipse runtime with the JRE version used for projects in the workspace.

Eclipse is also an ordinary Java program, so you must have a JRE as a running environment. If you do not have any JRE installed on your machine (or JDK, this article does not make a distinction between the two), then click Eclipse.exe will complain that the JRE could not be found. You can install a JRE at this point, or copy the JRE directory directly to the Eclipse installation directory.

Each project in eclipse can specify a different JRE version for the project, such as a project using JDK1.4 compilation, and B project using JDK1.5 compilation. This JDK version is not directly related to eclipse running JRE.

The JDK version of the project is easy to modify, so any JRE that specifies eclipse startup?

The order in which the JRE is found at eclipse startup is that if the-VM parameter is configured in Eclipse.ini, then the JRE specified by this parameter is used, or if there is a JRE folder under the Eclipse installation directory, if so, use the JRE; Otherwise, go to the system to find the installed JRE, if you can not find the error.

So if you don't want to uninstall the other JDK, there are two ways: (1) directly copy the JRE folder you want to use in the Eclipse directory, which is a common method for lazy people (2) modify the Eclipse.ini file, add-VM parameters, specify the address of the virtual machine to run, use-VM Example of a command line argument:-VM C:\jre\bin\javaw.exe

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.