java javax.ws.rs 包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10004485/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 23:13:00  来源:igfitidea点击:

javax.ws.rs package

javarestweb-servicesjakarta-eejax-rs

提问by user238021

I am learning RESTful Web Services and all the tutorials use javax.ws.rs.*package. But with JDK 6 and JDK 7, my Eclipse doesn't seem to recognize javax.wspackage. What am I missing here?

我正在学习 RESTful Web 服务,所有教程都使用javax.ws.rs.*包。但是对于 JDK 6 和 JDK 7,我的 Eclipse 似乎无法识别javax.ws包。我在这里错过了什么?

采纳答案by McDowell

javax.ws.rsis not a JDK package; it is a server-side API that forms part of the Java EE specification. You would need to include a Java EE runtime on your classpath or source an implementation from a 3rd party if you're going the self-assemblyroute (e.g. using Tomcat.)

javax.ws.rs不是 JDK 包;它是一个服务器端 API,构成了 Java EE 规范的一部分。如果您要走自组装路线(例如使用 Tomcat),则需要在类路径中包含 Java EE 运行时或从第 3 方获取实现。

回答by tenorsax

You're may be missing Jerseyinstallation, or something in your environment configuration. Try also installing Eclipse WPT. You can follow this tutorial, it covers prerequisites and basic installation procedures as well.

您可能缺少Jersey安装或环境配置中的某些内容。也尝试安装Eclipse WPT。您可以按照本教程进行操作,它也涵盖了先决条件和基本安装过程。