(转)JAX-RS (REST Web Services) 2.0 requires Java 1.6 or newer.

作者:海边凝望      来源:CSDN
原文:https://blog.csdn.net/xingyuexi87/article/details/76928110 

===========================================================================

maven 项目出现JAX-RS (REST Web Services) 2.0 requires Java 1.6 or newer.错误

解决办法:

      这个是eclipse的bug,  可见这个链接:https://bugs.eclipse.org/bugs/show_bug.cgi?id=416704

即在pom下将1.6改为1.8  如下:

<!--在pom文件 <build>里面 -->
<plugins>
    <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
             <source>1.8</source>
             <target>1.8</target>
        </configuration>
    </plugin>
</plugins>   

改过后可能出现问题: 

Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix

右击错误,选择Quick Fix。

原因:

这是因为pom被修改后,工程没有同步;可maven-update project进行同步

 

猜你喜欢

转载自www.cnblogs.com/ic710/p/11074767.html