简体   繁体   English

无法在centos 6中安装的eclipse中运行jsp项目

[英]Unable to run a jsp project in eclipse installed in centos 6

I have installed eclipse-jee-luna-R-linux-gtk-x86_64 in my centos 6 and also installed tomcat 6. 我已经在centos 6中安装了eclipse-jee-luna-R-linux-gtk-x86_64,还安装了tomcat 6。

My problem is that i am not able to run jsp project.when i right click on my project and select run on server a window appears with disable radio button of choose an existing server 我的问题是我无法运行jsp project。当我右键单击我的项目并选择在服务器上运行时,出现一个带有选择现有服务器的禁用单选按钮的窗口

在此处输入图片说明

I have also added Apache Tomcat from window prefrences option in eclipse. 我还从eclipse中的window prefrences选项中添加了Apache Tomcat。 what should i do? 我该怎么办? Any help would be appreciated 任何帮助,将不胜感激

This is because you haven't installed any apache server in your machine. 这是因为您尚未在计算机中安装任何apache服务器。

Check here how to install apache on centOS. 在此处检查如何在centOS上安装apache。

then you will be able to select installed version. 然后您将能够选择已安装的版本。

Edited link. 编辑的链接。 i hope this will help you. 我希望这能帮到您。

I just solved a similar problem on a fresh install of Eclipse Luna on CentOS 7. 我刚刚在CentOS 7上全新安装Eclipse Luna时解决了类似的问题。

In my case, the root of the problem of not being able to (a) see an existing server that has been defined in Window -> Preferences -> Server and/or to (b) create a new server from to page you have shown above, was a permission problem that I found when I tried to create a new server from the Webcontent page I wanted to run on the server. 就我而言,问题的根源在于无法(a)查看在Window-> Preferences-> Server中定义的现有服务器和/或(b)从显示的页面创建新服务器。上面是我尝试从要在服务器上运行的Webcontent页面创建新服务器时发现的权限问题。

All installation guides I've seen suggest to install Tomcat in /opt/whatever-your-Tomcat-version-is . 我见过的所有安装指南都建议将Tomcat安装在/opt/whatever-your-Tomcat-version-is Starting the server usually requires root privileges or defining a group or user combination with appropriate privileges to start/stop Tomcat. 启动服务器通常需要root特权或定义具有适当特权的组或用户组合才能启动/停止Tomcat。 If you're logged in as non-root-user and try to start Tomcat via Eclipse, your user privileges most likely do not allow you to start Tomcat. 如果您以non-root-user身份登录并尝试通过Eclipse启动Tomcat,则您的用户权限很可能不允许您启动Tomcat。

I solved my problem by first copying Tomcat into my workspace and changing the ownership... 我先将Tomcat复制到工作区并更改了所有权,从而解决了问题。

cp -R /opt/whatever-your-Tomcat-version-is ~/workspace/ 

chown -R your-username:your-username ~/workspace/whatever-your-Tomcat-version-is

...and then pointing Eclipse to use that instance of Tomcat. ...然后指向Eclipse以使用该Tomcat实例。 This worked immediately and I was able to start/stop the server and run my test webapp. 这立即生效,我能够启动/停止服务器并运行我的测试Webapp。

Note: You have to make sure that no other Tomcat is running on your system (eg if configured to start automatically after boot, eg by using ps -ax | grep tomcat ), else the Tomcat startup fails because of port conflicts (which can be prevented if you change port definitions in your Tomcat config file). 注意:您必须确保系统上没有运行其他Tomcat(例如,如果配置为在引导后自动启动,例如,通过使用ps -ax | grep tomcat ),否则Tomcat由于端口冲突而启动失败(可能是如果您在Tomcat配置文件中更改端口定义,则阻止此操作)。

BTW, one more suggestion: Tomcat 6 is outdated because of the JDK dependencies (1.5) that are no longer supported. 顺便说一句,另一个建议:由于不再支持JDK依赖项(1.5),Tomcat 6已过时。 I suggest you use the latest Tomcat 7 with JDK 1.7 (not 1.6 as suggested on the Tomcat 7 home page -- as 1.6 is also outdated and longer supported). 我建议您将最新的Tomcat 7与JDK 1.7一起使用(而不是像Tomcat 7主页上所建议的那样使用1.6,因为1.6也已过时,并且不再受支持)。

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

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