无法解析符号“HttpServerFactory”在IntelliJ IDEA中 [英] Cannot resolve symbol "HttpServerFactory" in IntelliJ IDEA

查看:609
本文介绍了无法解析符号“HttpServerFactory”在IntelliJ IDEA中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个关于RESTful服务的小项目。
所以我启动IntelliJ IDEA并执行:

I am trying to create a small project concerning RESTful services. So I fire up IntelliJ IDEA and do:

新建项目 - >(选择Java) - >(选择RESTful WebService 2.2) - >选中生成客户端和服务器代码,选择下载所需的库。

New Project -> (select Java) -> (select RESTful WebService 2.2) -> check "Generate client and server code", select to download needed libraries.

然后当转到创建的 HelloWorld 类时,我得到了以下错误:
无法解析符号HttpServerFactory以及无法解析符号jersey import: import com.sun.jersey.api.container.httpserver.HttpServerFactory;

Afterwards when going to the created HelloWorld class I get the following error: cannot resolve symbol "HttpServerFactory" as well as cannot resolve symbol "jersey" for this import: import com.sun.jersey.api.container.httpserver.HttpServerFactory;.

任何想法如何解决这个问题?

Any ideas how to solve this problem?

推荐答案

或者,在模块设置页面上更改Jersey库的版本。显然他们在更高版本中删除了HttpServerFactory ...

Alternatively, change the version of the Jersey library on your Module settings page. Apparently they removed the HttpServerFactory on later versions...

要更改版本,请右键单击模块并选择打开模块设置(F4)。从左侧单击左侧的Libraries,从库列表中选择jersey,然后单击Change Version。 v1.12为我工作。

To change the version, right click on your module and select 'Open Module Settings (F4)'. From there on click Libraries on the left, select jersey from the library list, then click "Change Version". v1.12 worked for me.

这篇关于无法解析符号“HttpServerFactory”在IntelliJ IDEA中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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