Workspace defines a VM that does not contain a valid Jre/lib/rt.jar:c:\program files\java\jre7

Source: Internet
Author: User

Two messages at Maven compile time (workspace and default Classpath container) Blog Category:
    • Java
With Maven for more than a year, it is always a matter of two obscure compilation messages, and the two messages are as follows:
Java code
    1. [INFO] Using Eclipse Workspace:d:\maven\workspace
    2. [WARNING] Workspace defines a VM that does not contain a valid Jre/lib/rt.jar:c:\program files\java\jre7
    3. [INFO] Adding default Classpath container:org.eclipse.jdt.launching.jre_container/ org.eclipse.jdt.internal.debug.ui.launcher.standardvmtype/javase-1.6


Always do not understand why these two information, the morning finally understand, in fact, everything still from the compile time automatically converted the JRE said.
Each time the MAVEN project is compiled, its JRE System library in eclipse will always become JavaSE-1.6 instead of its own JRE, and then try to find the answer under Google with two URLs as follows
What do Maven use Eclipse workspace default JRE?
Http://stackoverflow.com/questions/12322202/how-to-make-maven-use-eclipse-workspace-default-jre
The famous StackOverflow, and one found on the MAVEN website, is linked as follows
The JDK is being used is different than expected
Http://maven.apache.org/plugins/maven-eclipse-plugin/trouble-shooting/jdk-being-used-is-different-than-expected.html

So slowly try to eliminate these two seemingly normal abnormal info/waring, two steps
1: In StackOverflow, the JRE pointed to eclipse may have a problem, and then checked, found that Jre_home point to the JRE directory, changed to the JDK directory

2: The MAVEN compilation plugin corresponds to the JDK version of the machine, such as I wrote in the project 1.6, and the machine is installed JDK1.7
Java code
    1. <plugin>
    2. <artifactId>maven-compiler-plugin</artifactId>
    3. <version>2.3. 2</version>
    4. <configuration>
    5. <source>1.6</source>
    6. <target>1.6</target>
    7. <encoding>utf-8</encoding>
    8. </configuration>
    9. </plugin>

After Setup, the following information appears
Java code
    1. [INFO] Using Eclipse Workspace:d:\maven\workspace
    2. [INFO] Adding default Classpath container:org.eclipse.jdt.launching.JRE_CONTAINER

Workspace defines a VM that does not contain a valid Jre/lib/rt.jar:c:\program files\java\jre7

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.