JAR文件C:\ ... Tomcat-8.0 \ lib \ servlet-api.jar没有源附件 [英] The JAR file C:\...Tomcat-8.0\lib\servlet-api.jar has no source attachment

查看:437
本文介绍了JAR文件C:\ ... Tomcat-8.0 \ lib \ servlet-api.jar没有源附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了Ctrl +单击HttpServlet来查看HttpServlet的源代码,但是它给了我这个错误:

I did Ctrl+Click on HttpServlet to see source code of HttpServlet, but it gave me this error:

如何解决此问题?它说,我应该下载"servlet-api.jar",但是当我尝试下载时,我不明白应该下载哪一个?有很多servlet-api.jar文件.

How to fix this? It says, I should download "servlet-api.jar", but when I try to download, I can not understand which one should I download? There are lot of servlet-api.jar files.

推荐答案

源代码不一定特定于Servlet API,而是特定于Servlet实现本身.在您的特定情况下,Tomcat是Servlet实现.因此,您需要访问其首页来找到源代码的下载链接.通常,它与下载二进制文件的位置相同.

The source code is not necessarily specific to the Servlet API, but to the Servlet Implementation itself. In your particular case, Tomcat is the Servlet Implementation. So, you need to head to its homepage to find download links to the source code. Usually it's at the same place as where you downloaded the binaries.

Tomcat 8.0下载页面位于此处,如果滚动到底部,则您应该会看到这些链接:

Tomcat 8.0 download page is here, if you scroll to bottom, then you should see those links:

二进制分布

  • 核心:
    • zip <-这是Tomcat服务器本身.
    • ...

Binary Distributions

  • Core:
    • zip <-- this is Tomcat server itself.
    • ...
  • ...
  • zip <-包含源代码.
  • ...
  • zip <-- this contains the source code.

下载源代码zip,将其放在文件系统中的某个位置(我通常将其放在Tomcat安装文件夹中;请注意,您无需解压缩它!).最后,在Eclipse中按附加源按钮,然后指向该源代码zip文件.

Download the source code zip, put it somewhere in your file system (I usually put it in Tomcat installation folder; do note that you do not need to extract it!). Finally, press Attach Source button in Eclipse and point to that source code zip file.

这篇关于JAR文件C:\ ... Tomcat-8.0 \ lib \ servlet-api.jar没有源附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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