为什么Eclipse Kepler SR1错误:JAX-RS 2.0需要Java 1.7或更高版本 [英] Why does Eclipse Kepler SR1 error with : JAX-RS 2.0 requires Java 1.7 or newer

查看:242
本文介绍了为什么Eclipse Kepler SR1错误:JAX-RS 2.0需要Java 1.7或更高版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个maven项目提供以下两个错误



无法安装JAX-RS(REST Web服务)2.0:一个或多个约束还没有满足了。

JAX-RS(REST Web Services)2.0需要Java 1.7或更高版本。



我已经安装了JDK 1.6(我不能改变这个)



项目方面没有勾选JAX-RS。



项目facet具有java 1.6 set



项目方面有动态Web项目2.4集。



我有以下插件



Sonar 3.2.0
MercurialEclipse 2.10
EclEmma 2.2.1



pom.xml只是这个.. 。

 <?xml version =1.0encoding =UTF-8?> 
< project xmlns =http://maven.apache.org/POM/4.0.0xmlns:xsi =http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation =http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">
< modelVersion> 4.0.0< / modelVersion>
< groupId> com.pcmsgroup.v21.esi< / groupId>
< artifactId> customerservice-war< / artifactId>
< version> 2.0.0-SNAPSHOT< / version>
< / project>

web.xml是

 <?xml version =1.0encoding =UTF-8?> 
< web-app version =2.4xmlns =http://java.sun.com/xml/ns/j2ee
xmlns:xsi =http://www.w3。 org / 2001 / XMLSchema-instance
xsi:schemaLocation =http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web- app_2_4.xsd>
< display-name>客户服务< / display-name>
< / web-app>

清理或更新Maven项目没有任何区别。



注意:这是在eclipse-jee-kepler-SR1-win32-x86_64中。
注意:版本eclipse-jee-kepler-win32-x86_64没有给出错误。



注意:新工作区不会更改错误。 >

注意:我正在使用JDK.1.6.0_43



我可以看到的唯一错误与 .log文件是..



!ENTRY org.eclipse.osgi 2 1 2013-10-16 15:07:58.816
!MESSAGE NLS未使用的消息:JaxrsProjectConfigurator_The_project_does_not_contain_required_facets in:org.eclipse.m2e.wtp.jaxrs.internal.messages



添加方面,不要让我应用它,因为它说我需要Java 1.7



JSR339( JSR339 )声明API将广泛使用注释,并将
需要J2SE 6.0或更高版本



任何想法?

解决方案

删除 .project 并消除我从你的源代码控制。而不是使用导入 - >现有项目,请使用导入 - > Maven项目,并让m2e配置您的Eclipse项目。


I have a maven project that give the following two errors

JAX-RS (REST Web Services) 2.0 can not be installed : One or more constraints have not been satisfied.
JAX-RS (REST Web Services) 2.0 requires Java 1.7 or newer.

I have JDK 1.6 installed (I cant change this)

The project facets does NOT have JAX-RS ticked.

The project facets has java 1.6 set.

The project facets has Dynamic Web Project 2.4 set.

I have following plugins

Sonar 3.2.0 MercurialEclipse 2.10 EclEmma 2.2.1

The pom.xml is just this...

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.pcmsgroup.v21.esi</groupId>
    <artifactId>customerservice-war</artifactId>
    <version>2.0.0-SNAPSHOT</version>
</project>

the web.xml is

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Customer Service</display-name>
</web-app>

Cleaning or "Update Maven Project" makes no difference.

Note: This is in eclipse-jee-kepler-SR1-win32-x86_64. Note: Version eclipse-jee-kepler-win32-x86_64 does not give the error.

Note: New workspace does not change the error.

Note: I'm using JDK.1.6.0_43

The only error I can see related to this in the ".log" file is..

!ENTRY org.eclipse.osgi 2 1 2013-10-16 15:07:58.816 !MESSAGE NLS unused message: JaxrsProjectConfigurator_The_project_does_not_contain_required_facets in: org.eclipse.m2e.wtp.jaxrs.internal.messages

Adding the facet, wont let me apply it since it says I need Java 1.7

JSR339 (JSR339) states "The API will make extensive use of annotations and will require J2SE 6.0 or later"

Any ideas?

解决方案

Delete the .project file and banish it from your source control. Instead of using Import -> Existing Project, use Import -> Maven project, and let m2e configure your Eclipse project.

这篇关于为什么Eclipse Kepler SR1错误:JAX-RS 2.0需要Java 1.7或更高版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆