As we know JAX-RS 1.1 is part of Java EE 6.
Is it possible to use JAX-RS 2.0 as a dependency in Java EE 6 application?
The spec for JSR 339: JAX-RS 2.0: The Java API for RESTful Web Services explicitly addresses whether it is possible to use it in a Java EE 6 application, and the answer is yes:
2.2 What is the target Java platform? (i.e., desktop, server, personal, embedded, card, etc.)
This specification is targeted for Java SE 6.0 or higher and Java EE 6 or higher platforms.
2.3 The Executive Committees would like to ensure JSR submitters think about how their proposed technology relates to all of the Java platform editions. Please provide details here for which platform editions are being targeted by this JSR, and how this JSR has considered the relationship with the other platform editions.
This JSR will be available standalone. It is also targeted for inclusion in the Java EE 7 platform. Additionally, Java EE 6 products will be allowed to implement JAX-RS 2.0 instead of JAX-RS 1.1.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Update:
A few more points of clarification:
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=416704 which fixed an bug where Eclipse incorrectly required Java 7 rather than Java 6 when using JAX-RS 2.0 facets.
O'Reilly's RESTful Java with JAX-RS 2.0 only requires "JDK 6.0 or later" to run its examples.
Note that JAX-RS 2.1 requires Java 8 since "The API will make extensive use of annotations and lambda expressions that require Java SE 8 or later."