简体   繁体   English

Tomcat服务器不是从Mac中的Eclipse Oxygen启动

[英]Tomcat Server Not Starting from Eclipse Oxygen in Mac

I added tomcat 8 and 9 both in my eclipse oxygen and tried to run Spring based Web Application on the tomcat server but its giving error in console: 我在eclipse氧气中添加了tomcat 8和9,并尝试在tomcat服务器上运行基于Spring的Web应用程序,但在控制台中出现了错误:

Error: Could not create the Java Virtual Machine. 错误:无法创建Java虚拟机。 Error: A fatal exception has occurred. 错误:发生致命异常。 Program will exit 程序将会退出

In popup it gives the error: 在弹出窗口中,它给出错误:

'Server Tomcat v9.0 Server at localhost' has encountered a problem Server Tomcat v9.0 Server at localhost failed to start. “本地主机上的Server Tomcat v9.0服务器”遇到问题在本地主机上的Server Tomcat v9.0 Server无法启动。

How to fix this? 如何解决这个问题?

Please do a "ping localhost" on a terminal. 请在终端上执行“ ping localhost”。 if it is responding something like 如果它正在响应类似

ping: cannot resolve localhost: Unknown host ping:无法解析本地主机:未知主机

Chances are you don't have "127.0.0.1 localhost" line in your hosts file (/etc/hosts). 您的主机文件(/ etc / hosts)中可能没有“ 127.0.0.1 localhost”这一行。 So, just add it there. 因此,只需将其添加到此处即可。 Sometimes the line is there but it is still not working. 有时这条线在那里,但仍然无法正常工作。 The issue can be with the "Line Endings" on /etc/hosts file. 问题可能出在/ etc / hosts文件中的“行尾”。 Check it using Sublime (View/Line Endings). 使用Sublime(View / Line Ends)检查它。 If it is set to "Mac OS" just change it to "Unix". 如果将其设置为“ Mac OS”,则将其更改为“ Unix”。 After do this, try again to ping localhost. 完成此操作后,再次尝试ping localhost。 If it is going as expected just try again Running/Debugging on Server in Eclipse. 如果按预期进行,请再次尝试在Eclipse中的服务器上运行/调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM