Download and install button in greyed out in Eclipse for Apache Tomcat v8.0

半城伤御伤魂 提交于 2020-01-03 08:33:17

问题


I want Eclipse to download and install Apache Tomcat server environment but that option is greyed out for me

Any idea what might be missing?

Eclipse details :
Eclipse Java EE IDE for Web Developers.
Version: Mars.2 Release(4.5.2)
Java 8

回答1:


You can download tomcat separatly, than you can specify particulare installation path




回答2:


It appears that this is caused by the lack of installable runtimes being defined for a given version of Tomcat in eclipse's org.eclipse.jst.server.tomcat.core plugin.

In my case, I had eclipse "Photon" installed on my Windows box. In this version, the Download and Install button is active for Tomcat 8.0, but it is not for 8.5:

To enable it, I had to add two entries to the plugin.xml in the org.eclipse.jst.server.tomcat.core jar, located in the plugins dir:

The entries are as follows, under the org.eclipse.wst.server.core.installableRuntimes extension node:

<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>

I just chose the latest 8.5 binaries available from archive.apache.org and obtained the archiveSize and fileCount values with ls and find | 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

After updating the plugin jar, I modified eclipse.ini to add the -clean flag such that all plugin cache is purged. Remember to remove this after re-launching, as it will obviously cause eclipse to start up much more slowly:

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

Once eclipse is up, the button is now enabled for 8.5 and functions as expected:




回答3:


It seems to be a fixed bug (here) . But as a java developer I personally prefer to configure my development environment by myself, it's a very good source to learn more about common issues in development and deployment.



来源:https://stackoverflow.com/questions/39533711/download-and-install-button-in-greyed-out-in-eclipse-for-apache-tomcat-v8-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!