我已经安装了Apache Tomcat v9.0。
我已经安装了java jdk和jre1.8.0_131并设置了类路径。
首先我安装了 JST适配器和扩展,然后我就可以添加Apache Tomcat服务器了。
当我再次点击绿色运行按钮时,它会显示以下内容:
Tomcat v9.0 Server在localhost上所需的几个端口(8005,8080,8009)已在使用中。服务器可能已在另一个进程中运行,或者系统进程可能正在使用该端口。要启动此服务器,您需要停止其他进程或更改端口号。
我通过 Window-> Preferences-> Server-> Runtime Environments 添加了Apache Tomcat v9.0,然后点击添加然后选择 Apache Tomcat v9.0 然后点击下一步,然后浏览 C:\ Program Files \ Apache Software Foundation \ Tomcat 9.0 的路径并选择 jre1.8.0_131 然后点击完成
我之前也尝试更改端口号,但没有帮助。 然后在stackoverflow上回答我做了以下事情: 我点击窗口 - >显示视图 - >其他 - >服务器 - >服务器然后点击确定 然后出现服务器标签。我在localhost 打开 Tomcat v9.0服务器。 然后我打开打开启动配置,然后从Tomcat的 bin 文件夹中选择 tomcat-juli.jar ,然后点击确定。
当我运行服务器时,它出现在控制台选项卡中:
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/9.0.0.M21
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: May 4 2017 22:42:36 UTC
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 9.0.0.0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_131
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_131-b11
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\aakri\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 9.0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\aakri\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\aakri\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 9.0\endorsed
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
May 15, 2017 2:51:05 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_131\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_131\bin;C:\eclipse;;.]
May 15, 2017 2:51:05 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
May 15, 2017 2:51:05 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
May 15, 2017 2:51:05 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
May 15, 2017 2:51:05 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
May 15, 2017 2:51:05 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1339 ms
May 15, 2017 2:51:05 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
May 15, 2017 2:51:05 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.0.M21
May 15, 2017 2:51:06 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
May 15, 2017 2:51:06 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
May 15, 2017 2:51:06 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 951 ms
编辑: 我试图联系到http://localhost:8080/UserHome:
编辑2:我无法使用上面提到的eclipse版本部署 jar文件和 servlet api 的程序集,所以我改变了eclipse当前版本到版本:氧气释放里程碑5(4.7.0 M5)我也将tomcat v9更改为 v8.5 。然后成功部署了装配,现在两者都运行良好。