在Eclipse中为Apache Tomcat v8.0下载并安装灰色按钮

问题描述 投票:8回答:3

我希望Eclipse下载并安装Apache Tomcat服务器环境,但该选项对我来说是灰色的

enter image description here

知道可能缺少什么吗?

Eclipse details :
Eclipse Java EE IDE for Web Developers.
Version: Mars.2 Release(4.5.2)
Java 8
eclipse tomcat java-ee
3个回答
0
投票

您可以单独下载tomcat,也可以指定特定的安装路径


0
投票

看起来这是由于缺少可在eclipse的org.eclipse.jst.server.tomcat.core插件中为给定版本的Tomcat定义的可安装运行时。

在我的情况下,我在我的Windows机器上安装了“Photon”。在这个版本中,Download and Install按钮对于Tomcat 8.0是活动的,但它不适用于8.5:

enter image description here

为了启用它,我不得不在位于插件目录的plugin.xml jar中的org.eclipse.jst.server.tomcat.core中添加两个条目:

enter image description here

org.eclipse.wst.server.core.installableRuntimes扩展节点下的条目如下:

<extension point="org.eclipse.wst.server.core.installableRuntimes">
    ...
    <runtime
        id="org.eclipse.jst.server.tomcat.runtime.85"
        licenseUrl="http://www.apache.org/licenses/LICENSE-2.0.txt"
        archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.38/bin/apache-tomcat-8.5.38-windows-x86.zip"
        archivePath="apache-tomcat-8.5.38"
        archiveSize="11402963"
        fileCount="645"
        os="win32"/>
    <runtime
        id="org.eclipse.jst.server.tomcat.runtime.85"
        licenseUrl="http://www.apache.org/licenses/LICENSE-2.0.txt"
        archiveUrl="http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.38/bin/apache-tomcat-8.5.38.tar.gz"
        archivePath="apache-tomcat-8.5.38"
        archiveSize="9672042"
        fileCount="641"
        os="linux"/>
</extension>

我刚刚从archive.apache.org选择了最新的8.5二进制文件,并使用archiveSizefileCount获得了lsfind | wc值:

$ ls -l
-rw-r--r-- 1 cody group  9672042 Feb  5 07:21 apache-tomcat-8.5.38.tar.gz
-rw-r--r-- 1 cody group 11402963 Feb  5 07:21 apache-tomcat-8.5.38-windows-x86.zip

$ find apache-tomcat-8.5.38 -type f | wc -l
641

更新插件jar后,我修改了eclipse.ini以添加-clean标志,以便清除所有插件缓存。记得在重新启动后删除它,因为它显然会导致eclipse启动得慢得多:

-clean
-startup
plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar
--launcher.library
...

eclipse启动后,按钮现在启用8.5并按预期运行:

enter image description here


-1
投票

这似乎是一个固定的错误(here)。但作为一名java开发人员,我个人更喜欢自己配置我的开发环境,这是了解开发和部署中常见问题的更好资源。

© www.soinside.com 2019 - 2024. All rights reserved.