Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

enter image description here

Any idea what might be missing?

Eclipse details :
Eclipse Java EE IDE for Web Developers.
Version: Mars.2 Release(4.5.2)
Java 8
like image 760
Aniket Thakur Avatar asked Sep 16 '16 14:09

Aniket Thakur


2 Answers

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:

enter image description here

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:

enter image description here

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:

enter image description here

like image 168
cody Avatar answered Oct 23 '22 04:10

cody


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

like image 29
Andrey Avatar answered Oct 23 '22 03:10

Andrey