• <bdo id='Eid2X'></bdo><ul id='Eid2X'></ul>

      <tfoot id='Eid2X'></tfoot>

    1. <legend id='Eid2X'><style id='Eid2X'><dir id='Eid2X'><q id='Eid2X'></q></dir></style></legend>

        <i id='Eid2X'><tr id='Eid2X'><dt id='Eid2X'><q id='Eid2X'><span id='Eid2X'><b id='Eid2X'><form id='Eid2X'><ins id='Eid2X'></ins><ul id='Eid2X'></ul><sub id='Eid2X'></sub></form><legend id='Eid2X'></legend><bdo id='Eid2X'><pre id='Eid2X'><center id='Eid2X'></center></pre></bdo></b><th id='Eid2X'></th></span></q></dt></tr></i><div id='Eid2X'><tfoot id='Eid2X'></tfoot><dl id='Eid2X'><fieldset id='Eid2X'></fieldset></dl></div>
      1. <small id='Eid2X'></small><noframes id='Eid2X'>

      2. Maven对使用JRE感到困惑

        Maven confused about JRE been used(Maven对使用JRE感到困惑)

          <legend id='X3yCJ'><style id='X3yCJ'><dir id='X3yCJ'><q id='X3yCJ'></q></dir></style></legend>
          • <small id='X3yCJ'></small><noframes id='X3yCJ'>

              <i id='X3yCJ'><tr id='X3yCJ'><dt id='X3yCJ'><q id='X3yCJ'><span id='X3yCJ'><b id='X3yCJ'><form id='X3yCJ'><ins id='X3yCJ'></ins><ul id='X3yCJ'></ul><sub id='X3yCJ'></sub></form><legend id='X3yCJ'></legend><bdo id='X3yCJ'><pre id='X3yCJ'><center id='X3yCJ'></center></pre></bdo></b><th id='X3yCJ'></th></span></q></dt></tr></i><div id='X3yCJ'><tfoot id='X3yCJ'></tfoot><dl id='X3yCJ'><fieldset id='X3yCJ'></fieldset></dl></div>
              • <bdo id='X3yCJ'></bdo><ul id='X3yCJ'></ul>
                  <tbody id='X3yCJ'></tbody>

                1. <tfoot id='X3yCJ'></tfoot>
                  本文介绍了Maven对使用JRE感到困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 eclipse 中创建了一个项目并添加了 maven 依赖项.在 Eclipse 中,它说我正在使用 JRE 1.5.在 Eclipse 中一切正常,例如,我可以运行我的测试.

                  I've created a project in eclipse and added maven dependencies. In Eclipse, it says that I am using JRE 1.5. Everything works fine in Eclipse, for instance, I can run my tests.

                  当我尝试从终端运行 mvn clean install 时,出现以下错误.

                  When I try to run mvn clean install from the terminal, it gives me the following error.

                  ...-source 1.3 不支持泛型(使用 -source 5 或更高版本来启用泛型)...

                  ...generics are not supported in -source 1.3 (use -source 5 or higher to enable generics)...

                  Maven 似乎认为我使用的是 JRE 1.3,无法识别泛型或 for-each 循环.

                  Its seems that Maven thinks I'm using JRE 1.3 and cannot recognize generics or for-each loops.

                  我该怎么做:

                  • 验证我的假设,即 maven 使用了错误的版本.
                  • 让 Maven 编译我的项目.

                  推荐答案

                  在 Maven 编译器插件中指定正确的 JRE 版本,默认情况下你的 pom.xml 文件将继承编译器插件来自针对 1.3 JRE 的 Maven 超级 pom.xml.

                  Specify the correct version of your JRE in the Maven compiler plugin, by default your pom.xml file will inherit the compiler-plugin from the Maven super pom.xml which targets the 1.3 JRE.

                       <build>
                          <plugins>
                              <plugin>
                                  <artifactId>maven-compiler-plugin</artifactId>
                                  <configuration>
                                      <source>1.5</source>
                                      <target>1.5</target>
                                  </configuration>
                              </plugin>    
                          </plugins>
                      </build>
                  

                  这篇关于Maven对使用JRE感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                  <tfoot id='pCrlf'></tfoot>

                      <bdo id='pCrlf'></bdo><ul id='pCrlf'></ul>
                    • <i id='pCrlf'><tr id='pCrlf'><dt id='pCrlf'><q id='pCrlf'><span id='pCrlf'><b id='pCrlf'><form id='pCrlf'><ins id='pCrlf'></ins><ul id='pCrlf'></ul><sub id='pCrlf'></sub></form><legend id='pCrlf'></legend><bdo id='pCrlf'><pre id='pCrlf'><center id='pCrlf'></center></pre></bdo></b><th id='pCrlf'></th></span></q></dt></tr></i><div id='pCrlf'><tfoot id='pCrlf'></tfoot><dl id='pCrlf'><fieldset id='pCrlf'></fieldset></dl></div>
                      <legend id='pCrlf'><style id='pCrlf'><dir id='pCrlf'><q id='pCrlf'></q></dir></style></legend>
                          <tbody id='pCrlf'></tbody>
                        • <small id='pCrlf'></small><noframes id='pCrlf'>