tomcat8&日食火星噩梦

时间:2016-05-16 11:21:42

标签: java linux eclipse tomcat debian

我尝试了许多不同的方法来在Debian jessie发行版上安装Tomcat服务器,以便将它用作ecplise mars IDE的服务器。

对我的debian有用的唯一方法是直接从他们的repo安装Tomacat。 在经过一些小调整之后,它似乎在localhost:8080上有我需要的东西(说明tomcat有效的页面!)。

之后,我尝试使用许多教程建议的传统步骤在Eclipse上添加它:

- 通过INSTALL NEW SOFT添加xml和web工具支持 - 将安装路径文件夹添加到服务器等

然后,当我开始一个新项目,并尝试通过“服务器”选项卡添加服务器时,wizzard让我选择正确的服务器/ adptor,但是然后存在一些问题。

而不是: enter image description here

我得到了这个: enter image description here

我无法编辑服务器的名称,并且缺少字段,也没有希望完成或接下来。我怎样才能发现我的问题所在? 欢呼声

2 个答案:

答案 0 :(得分:0)

请勿尝试使用已安装的Tomcat副本。正如评论中所提到的,您的普通用户缺乏对其安装位置的所有权,并且Debian打包可能已经以Eclipse无法预测的方式更改了布局。从Apache下载tarball,解压缩并使用它 - 请记住,这是用于开发您的应用程序,您不应该在生产服务器安装中这样做。

您还应该查看WTP Tomcat FAQ以了解您可能遇到的其他问题。

答案 1 :(得分:0)

I found this on ubuntu's forum and with some edit about the version (mine is tomcat 8) works!!!! Thanks to all that point me in right direction

Here's the way I did it, it keeps the system tomcat and your own personal tomcat instance separate.

Install tomcat as per normal: sudo apt-get install tomcat7

Install private instance support: sudo apt-get install tomcat7-user

Create local instance in your home folder:

tomcat7-instance-create -p 10080 -c 10005 mytomcat

Note: -p sets the port number (default is 8080) and -c is the control port (default 8005), we set these so we don't compete with the main installation of tomcat running as a service. "mytomcat" can be anything you like, but it will create a directory by this name in your home.

Now use the following to make Eclipse happy:

cd mytomcat
ln -s /usr/share/tomcat7/lib
ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
ln -s /usr/share/tomcat7/bin/bootstrap.jar bin/bootstrap.jar
ln -s /usr/share/tomcat7/bin/tomcat-juli.jar bin/tomcat-juli.jar
mkdir -p common/classes;
mkdir -p server/classes;
mkdir -p shared/classes;

Now within Eclipse you can create a Tomcat v7.0 server and set the installation directory as ~/mytomcat.

Note: common, server and shared classes could be links too, but I wanted to keep the two separate.