在ubuntu上使用eclipse IDE创建Tomcat 6服务器

时间:2023-02-05 09:02:47

I'm having a problem running tomcat 6 with eclipse 3 in ubuntu.

我在ubuntu中使用eclipse 3运行tomcat 6时遇到问题。

I installed tomcat 6 on my machine and when I tested it using http://localhost:8080, it worked fine.

我在我的机器上安装了tomcat 6,当我使用http:// localhost:8080进行测试时,它工作正常。

But whenever i want to create a server in eclipse, i select Tomcat 6 , i get the following message "Cannot create a server using the selected type", and i can't click next.

但每当我想在eclipse中创建服务器时,我选择Tomcat 6,我收到以下消息“无法使用所选类型创建服务器”,我无法单击下一步。

Any idea why?

知道为什么吗?

17 个解决方案

#1


There’s a better workaround so you can keep Ubuntu’s Tomcat6 (taken from http://ubuntuforums.org/showthread.php?p=8541057, by DisDis)

有一个更好的解决方法,所以你可以保留Ubuntu的Tomcat6(取自http://ubuntuforums.org/showthread.php?p=8541057,由DisDis提供)

In a terminal:

在终端:

sudo apt-get install tomcat6
cd /usr/share/tomcat6
sudo ln -s /var/lib/tomcat6/conf conf
sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat6 log
sudo chmod -R 777 /usr/share/tomcat6/conf

There. Now just go to Window/Preferences/Sever/Runtime Environments, add the Apache Tomcat6 Server and use /usr/share/tomcat6 as the installation directory!

那里。现在只需转到Window / Preferences / Sever / Runtime Environments,添加Apache Tomcat6 Server并使用/ usr / share / tomcat6作为安装目录!

#2


ok, so here's what worked for me: you must go to Window>Preferences

好的,所以这里对我有用:你必须去Window> Preferences

here, go to Server>Runtime Environments

在这里,转到服务器>运行时环境

remove the old server or add your server or change the server location...

删除旧服务器或添加服务器或更改服务器位置...

(in my case, this problem arised when i changed the tomcat server location)

(在我的情况下,当我更改tomcat服务器位置时出现此问题)

now you should be able to add new servers to your environment :)

现在你应该能够在你的环境中添加新的服务器了:)

#3


Have you been using the ubuntu-tomcat version (e.g. "aptitude install tomcat6")? If so, please download a plain vanilla version from tomcat.apache.org and use this. The Debian/Ubuntu version relocates some jars around and eclipse expects the "pure" version and jar locations.

你一直在使用ubuntu-tomcat版本(例如“aptitude install tomcat6”)吗?如果是这样,请从tomcat.apache.org下载普通版本并使用它。 Debian / Ubuntu版本重新定位了一些罐子,eclipse期望“纯”版本和jar位置。

(Also: see Eclipse bug 239179)

(另请参阅Eclipse bug 239179)

#4


Remove (or edit the apache tomcat v6.0 entry in) workspace.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jst.server.tomcat.core.prefs

删除(或编辑apache tomcat v6.0条目)workspace.metadata.plugins \ org.eclipse.core.runtime.settings \ org.eclipse.jst.server.tomcat.core.prefs

I think you also need to restart

我想你还需要重启

#5


I wrote a patch for solving this problem and it has been merged in Ubuntu and Debian. Now its possible to configure tomcat6 inside Eclipse without any pains.

我写了一个补丁来解决这个问题,它已经在Ubuntu和Debian中合并了。现在可以在Eclipse中配置tomcat6而不会有任何痛苦。

In Ubuntu 11.04 you can install tomcat6-user package. Then configure a user instance of tomcat6 by running this command

在Ubuntu 11.04中,您可以安装tomcat6-user软件包。然后通过运行此命令配置tomcat6的用户实例

$tomcat6-instance-create ~/my-tomcat-dir

A user instance of tomcat6 will be configured in ~/my-tomcat-dir directory.

将在〜/ my-tomcat-dir目录中配置tomcat6的用户实例。

Now to add tomcat6 inside eclipse to setup your development environment, simply point eclipse towards this directory and you will be ready to go.

现在要在eclipse中添加tomcat6来设置你的开发环境,只需将eclipse指向这个目录,你就可以开始了。

If you are running an older version of Ubuntu, then you can simply download the latest version of tomcat6-user package from the Debian FTP: http://packages.debian.org/hu/sid/all/tomcat6-user/download

如果您运行的是旧版本的Ubuntu,那么您只需从Debian FTP下载最新版本的tomcat6-user软件包:http://packages.debian.org/hu/sid/all/tomcat6-user/download

#6


I had the same problem, but with tomcat 5.5. Changing the permissions on the /etc/tomcat5.5/conf (symlink from /usr/share/tomcat5.5/conf) worked. Thanks!

我遇到了同样的问题,但是使用了tomcat 5.5。更改/etc/tomcat5.5/conf(来自/usr/share/tomcat5.5/conf的符号链接)的权限有效。谢谢!

#7


I was suffering the same problem

我遇到了同样的问题

I've got the lattest eclipse 3.4.1 GanyMede. Changed the Ubuntu Tomcat 6 install to the plain one from tomcat.apache.org

我有最直接的日食3.4.1 GanyMede。从tomcat.apache.org将Ubuntu Tomcat 6安装更改为普通安装

chmod 666 /usr/share/tomcat6/conf*

chmod 666 / usr / share / tomcat6 / conf *

and the problem was solved

问题解决了

#8


I had the same problem but thanks to all your feedback I got it fixed. In summary...

我遇到了同样的问题但是感谢您的所有反馈我得到了解决。综上所述...

I have Ubuntu 9.04, Eclipse Galileo (java EE developers platform 3.5.1).

我有Ubuntu 9.04,Eclipse Galileo(Java EE开发人员平台3.5.1)。

I installed Tomcat as follows:

我按如下方式安装了Tomcat:

sudo tar zxvf apache-tomcat-6.0.20.tar.gz

sudo tar zxvf apache-tomcat-6.0.20.tar.gz

sudo cp -R apache-tomcat-6.0.20 /usr/share/tomcat6

sudo cp -R apache-tomcat-6.0.20 / usr / share / tomcat6

as explained at: http://www.ubuntugeek.com/tomcat-6-installation-on-ubuntu-feisty.html

如下所述:http://www.ubuntugeek.com/tomcat-6-installation-on-ubuntu-feisty.html

Then I change permissions to the conf folder /usr/share/tomcat6/conf$ sudo chmod a+rw *

然后我将权限更改为conf文件夹/ usr / share / tomcat6 / conf $ sudo chmod a + rw *

I removed it from Windows->Preferences->Server->Runtime Environment (but I don't think this step was necessary after all)

我从Windows-> Preferences-> Server-> Runtime Environment中删除了它(但我认为毕竟不需要这一步)

Voila!

#9


Go to window > preferences -- Go to runtime environments --- you will probably find the location of the old install of Tomcat. Changing it to the current location will help.

转到窗口>首选项 - 转到运行时环境---您可能会找到旧版Tomcat的安装位置。将其更改为当前位置将有所帮助。

#10


If you can test it with http://localhost:8080 then the server is already running, and there's nothing for Eclipse to create. try closing down the server, and then setting up eclipse to point to the installation directory.

如果您可以使用http:// localhost:8080对其进行测试,那么服务器已经在运行,并且Eclipse没有任何内容可供创建。尝试关闭服务器,然后设置eclipse指向安装目录。

#11


I you have the newer version of eclipse, try to update the Web Tool Plateform plugins in Help/software Updates... If both eclipse and WTP are up to date I don't see were the problem can be...

我有更新版本的eclipse,尝试更新帮助/软件更新中的Web Tool Plateform插件...如果eclipse和WTP都是最新的我不会看到问题可能是...

PS : there is a "comment" button, do not post an answer to comment an answer ;)

PS:有一个“评论”按钮,不发表回答评论答案;)

#12


This one is working for me too Window -> Options -> Server -> Runtime Environments

这个也适合我Window - >选项 - >服务器 - >运行时环境

Edit the existing runtime environment "Apache Tomcat v6.0" and select your tomcat's location.

编辑现有的运行时环境“Apache Tomcat v6.0”并选择tomcat的位置。

#13


You have to symlink various folders that are scattered across the file system to the desired tomcat6 main (or installation) folder.

您必须将分散在文件系统中的各种文件夹符号链接到所需的tomcat6主(或安装)文件夹。

tsaid suggested symlinking to /usr/share/tomcat6, I rather use /var/lib/tomcat6.

tsaid建议symlinking到/ usr / share / tomcat6,我宁愿使用/ var / lib / tomcat6。

My /var/lib/tomcat6 directory (see the symlinks I've made):

我的/ var / lib / tomcat6目录(​​参见我创建的符号链接):

$ ls -g -o /var/lib/tomcat6
lrwxrwxrwx 1   22 2010-07-20 18:15 bin -> /usr/share/tomcat6/bin
drwxr-xr-x 3 4096 2010-07-20 12:22 common
lrwxrwxrwx 1   12 2010-07-20 12:22 conf -> /etc/tomcat6
lrwxrwxrwx 1   22 2010-07-20 18:14 lib -> /usr/share/tomcat6/lib
lrwxrwxrwx 1   17 2010-07-20 12:22 logs -> ../../log/tomcat6
drwxr-xr-x 3 4096 2010-07-20 12:22 server
drwxr-xr-x 3 4096 2010-07-20 12:22 shared
drwxrwxr-x 3 4096 2010-07-20 12:22 webapps
lrwxrwxrwx 1   19 2010-07-20 12:22 work -> ../../cache/tomcat6

Also, don't forget to give full rw permission to your configuration files, in my case in /etc/tomcat6. Since you'll also need to symlink catalina.policy from Catalina/localhost/catalina.policy, don't forget giving execute permission to those folders. You can simplify with full permission to the conf folder, but it's only advised if you're the only user of the computer.

另外,不要忘记给你的配置文件赋予完整的rw权限,在我的情况下在/ etc / tomcat6中。由于您还需要从Catalina / localhost / catalina.policy中对符号链接catalina.policy,所以不要忘记为这些文件夹提供执行权限。您可以通过conf文件夹的完全权限进行简化,但只有在您是计算机的唯一用户时才会建议。

cd /var/lib/tomcat6/conf
chmod -R a+xrw *

Now, delete the entry in Eclipse under Window -> Preferences -> Server -> Runtime Environment and add a new server through Run on Server or anywhere else.

现在,在Window - > Preferences - > Server - > Runtime Environment下删除Eclipse中的条目,并通过Run on Server或其他任何地方添加新服务器。

#14


Not sure, but maybe your version of Eclipse does not support the latest Tomcat version? Try to update Eclipse. I have Eclipse 3.4 and there's no problem.

不确定,但是你的Eclipse版本可能不支持最新的Tomcat版本?尝试更新Eclipse。我有Eclipse 3.4,没有问题。

#15


I have been having the same problem (on fedora 9). You have to change the permissions of the files inside the tomcat conf directory to rw (chmod a+rw tomcat6/conf/*). Solved it for me!

我一直有同样的问题(在fedora 9上)。您必须将tomcat conf目录中的文件权限更改为rw(chmod a + rw tomcat6 / conf / *)。为我解决了!

#16


Window -> Options -> Server -> Runtime Environments

窗口 - >选项 - >服务器 - >运行时环境

Edit the existing runtime environment "Apache Tomcat v6.0" and select your tomcat's location.

编辑现有的运行时环境“Apache Tomcat v6.0”并选择tomcat的位置。

#17


I had the same problem, i use ubuntu 9.04 and tomcat 6.

我有同样的问题,我使用ubuntu 9.04和tomcat 6。

I installed the tomcat 6 for apt-get, installed also jre, jdk. (SUN)

我安装了tomcat 6 for apt-get,也安装了jre,jdk。 (太阳)

In order to resolve the problem do:

为了解决问题,请执行以下操作:

  • Close the Eclipse;
  • 关闭Eclipse;

  • Delete your workspace (save your files);
  • 删除工作区(保存文件);

  • stop the tomcat6 (/etc/init.d/tomcat6 stop)
  • 停止tomcat6(/etc/init.d/tomcat6停止)

  • make a link to conf (ln -s /var/lib/tomcat6/conf /usr/share/tomcat6);
  • 建立一个链接到conf(ln -s / var / lib / tomcat6 / conf / usr / share / tomcat6);

  • ln -s /var/lib/tomcat6/catalina.policy /etc/tomcat6/
  • ln -s /var/lib/tomcat6/catalina.policy / etc / tomcat6 /

  • init the eclipse
  • 初始化日食

  • In server tomcat configuration (/usr/share/tomcat6)
  • 在服务器tomcat配置中(/ usr / share / tomcat6)

#1


There’s a better workaround so you can keep Ubuntu’s Tomcat6 (taken from http://ubuntuforums.org/showthread.php?p=8541057, by DisDis)

有一个更好的解决方法,所以你可以保留Ubuntu的Tomcat6(取自http://ubuntuforums.org/showthread.php?p=8541057,由DisDis提供)

In a terminal:

在终端:

sudo apt-get install tomcat6
cd /usr/share/tomcat6
sudo ln -s /var/lib/tomcat6/conf conf
sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat6 log
sudo chmod -R 777 /usr/share/tomcat6/conf

There. Now just go to Window/Preferences/Sever/Runtime Environments, add the Apache Tomcat6 Server and use /usr/share/tomcat6 as the installation directory!

那里。现在只需转到Window / Preferences / Sever / Runtime Environments,添加Apache Tomcat6 Server并使用/ usr / share / tomcat6作为安装目录!

#2


ok, so here's what worked for me: you must go to Window>Preferences

好的,所以这里对我有用:你必须去Window> Preferences

here, go to Server>Runtime Environments

在这里,转到服务器>运行时环境

remove the old server or add your server or change the server location...

删除旧服务器或添加服务器或更改服务器位置...

(in my case, this problem arised when i changed the tomcat server location)

(在我的情况下,当我更改tomcat服务器位置时出现此问题)

now you should be able to add new servers to your environment :)

现在你应该能够在你的环境中添加新的服务器了:)

#3


Have you been using the ubuntu-tomcat version (e.g. "aptitude install tomcat6")? If so, please download a plain vanilla version from tomcat.apache.org and use this. The Debian/Ubuntu version relocates some jars around and eclipse expects the "pure" version and jar locations.

你一直在使用ubuntu-tomcat版本(例如“aptitude install tomcat6”)吗?如果是这样,请从tomcat.apache.org下载普通版本并使用它。 Debian / Ubuntu版本重新定位了一些罐子,eclipse期望“纯”版本和jar位置。

(Also: see Eclipse bug 239179)

(另请参阅Eclipse bug 239179)

#4


Remove (or edit the apache tomcat v6.0 entry in) workspace.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jst.server.tomcat.core.prefs

删除(或编辑apache tomcat v6.0条目)workspace.metadata.plugins \ org.eclipse.core.runtime.settings \ org.eclipse.jst.server.tomcat.core.prefs

I think you also need to restart

我想你还需要重启

#5


I wrote a patch for solving this problem and it has been merged in Ubuntu and Debian. Now its possible to configure tomcat6 inside Eclipse without any pains.

我写了一个补丁来解决这个问题,它已经在Ubuntu和Debian中合并了。现在可以在Eclipse中配置tomcat6而不会有任何痛苦。

In Ubuntu 11.04 you can install tomcat6-user package. Then configure a user instance of tomcat6 by running this command

在Ubuntu 11.04中,您可以安装tomcat6-user软件包。然后通过运行此命令配置tomcat6的用户实例

$tomcat6-instance-create ~/my-tomcat-dir

A user instance of tomcat6 will be configured in ~/my-tomcat-dir directory.

将在〜/ my-tomcat-dir目录中配置tomcat6的用户实例。

Now to add tomcat6 inside eclipse to setup your development environment, simply point eclipse towards this directory and you will be ready to go.

现在要在eclipse中添加tomcat6来设置你的开发环境,只需将eclipse指向这个目录,你就可以开始了。

If you are running an older version of Ubuntu, then you can simply download the latest version of tomcat6-user package from the Debian FTP: http://packages.debian.org/hu/sid/all/tomcat6-user/download

如果您运行的是旧版本的Ubuntu,那么您只需从Debian FTP下载最新版本的tomcat6-user软件包:http://packages.debian.org/hu/sid/all/tomcat6-user/download

#6


I had the same problem, but with tomcat 5.5. Changing the permissions on the /etc/tomcat5.5/conf (symlink from /usr/share/tomcat5.5/conf) worked. Thanks!

我遇到了同样的问题,但是使用了tomcat 5.5。更改/etc/tomcat5.5/conf(来自/usr/share/tomcat5.5/conf的符号链接)的权限有效。谢谢!

#7


I was suffering the same problem

我遇到了同样的问题

I've got the lattest eclipse 3.4.1 GanyMede. Changed the Ubuntu Tomcat 6 install to the plain one from tomcat.apache.org

我有最直接的日食3.4.1 GanyMede。从tomcat.apache.org将Ubuntu Tomcat 6安装更改为普通安装

chmod 666 /usr/share/tomcat6/conf*

chmod 666 / usr / share / tomcat6 / conf *

and the problem was solved

问题解决了

#8


I had the same problem but thanks to all your feedback I got it fixed. In summary...

我遇到了同样的问题但是感谢您的所有反馈我得到了解决。综上所述...

I have Ubuntu 9.04, Eclipse Galileo (java EE developers platform 3.5.1).

我有Ubuntu 9.04,Eclipse Galileo(Java EE开发人员平台3.5.1)。

I installed Tomcat as follows:

我按如下方式安装了Tomcat:

sudo tar zxvf apache-tomcat-6.0.20.tar.gz

sudo tar zxvf apache-tomcat-6.0.20.tar.gz

sudo cp -R apache-tomcat-6.0.20 /usr/share/tomcat6

sudo cp -R apache-tomcat-6.0.20 / usr / share / tomcat6

as explained at: http://www.ubuntugeek.com/tomcat-6-installation-on-ubuntu-feisty.html

如下所述:http://www.ubuntugeek.com/tomcat-6-installation-on-ubuntu-feisty.html

Then I change permissions to the conf folder /usr/share/tomcat6/conf$ sudo chmod a+rw *

然后我将权限更改为conf文件夹/ usr / share / tomcat6 / conf $ sudo chmod a + rw *

I removed it from Windows->Preferences->Server->Runtime Environment (but I don't think this step was necessary after all)

我从Windows-> Preferences-> Server-> Runtime Environment中删除了它(但我认为毕竟不需要这一步)

Voila!

#9


Go to window > preferences -- Go to runtime environments --- you will probably find the location of the old install of Tomcat. Changing it to the current location will help.

转到窗口>首选项 - 转到运行时环境---您可能会找到旧版Tomcat的安装位置。将其更改为当前位置将有所帮助。

#10


If you can test it with http://localhost:8080 then the server is already running, and there's nothing for Eclipse to create. try closing down the server, and then setting up eclipse to point to the installation directory.

如果您可以使用http:// localhost:8080对其进行测试,那么服务器已经在运行,并且Eclipse没有任何内容可供创建。尝试关闭服务器,然后设置eclipse指向安装目录。

#11


I you have the newer version of eclipse, try to update the Web Tool Plateform plugins in Help/software Updates... If both eclipse and WTP are up to date I don't see were the problem can be...

我有更新版本的eclipse,尝试更新帮助/软件更新中的Web Tool Plateform插件...如果eclipse和WTP都是最新的我不会看到问题可能是...

PS : there is a "comment" button, do not post an answer to comment an answer ;)

PS:有一个“评论”按钮,不发表回答评论答案;)

#12


This one is working for me too Window -> Options -> Server -> Runtime Environments

这个也适合我Window - >选项 - >服务器 - >运行时环境

Edit the existing runtime environment "Apache Tomcat v6.0" and select your tomcat's location.

编辑现有的运行时环境“Apache Tomcat v6.0”并选择tomcat的位置。

#13


You have to symlink various folders that are scattered across the file system to the desired tomcat6 main (or installation) folder.

您必须将分散在文件系统中的各种文件夹符号链接到所需的tomcat6主(或安装)文件夹。

tsaid suggested symlinking to /usr/share/tomcat6, I rather use /var/lib/tomcat6.

tsaid建议symlinking到/ usr / share / tomcat6,我宁愿使用/ var / lib / tomcat6。

My /var/lib/tomcat6 directory (see the symlinks I've made):

我的/ var / lib / tomcat6目录(​​参见我创建的符号链接):

$ ls -g -o /var/lib/tomcat6
lrwxrwxrwx 1   22 2010-07-20 18:15 bin -> /usr/share/tomcat6/bin
drwxr-xr-x 3 4096 2010-07-20 12:22 common
lrwxrwxrwx 1   12 2010-07-20 12:22 conf -> /etc/tomcat6
lrwxrwxrwx 1   22 2010-07-20 18:14 lib -> /usr/share/tomcat6/lib
lrwxrwxrwx 1   17 2010-07-20 12:22 logs -> ../../log/tomcat6
drwxr-xr-x 3 4096 2010-07-20 12:22 server
drwxr-xr-x 3 4096 2010-07-20 12:22 shared
drwxrwxr-x 3 4096 2010-07-20 12:22 webapps
lrwxrwxrwx 1   19 2010-07-20 12:22 work -> ../../cache/tomcat6

Also, don't forget to give full rw permission to your configuration files, in my case in /etc/tomcat6. Since you'll also need to symlink catalina.policy from Catalina/localhost/catalina.policy, don't forget giving execute permission to those folders. You can simplify with full permission to the conf folder, but it's only advised if you're the only user of the computer.

另外,不要忘记给你的配置文件赋予完整的rw权限,在我的情况下在/ etc / tomcat6中。由于您还需要从Catalina / localhost / catalina.policy中对符号链接catalina.policy,所以不要忘记为这些文件夹提供执行权限。您可以通过conf文件夹的完全权限进行简化,但只有在您是计算机的唯一用户时才会建议。

cd /var/lib/tomcat6/conf
chmod -R a+xrw *

Now, delete the entry in Eclipse under Window -> Preferences -> Server -> Runtime Environment and add a new server through Run on Server or anywhere else.

现在,在Window - > Preferences - > Server - > Runtime Environment下删除Eclipse中的条目,并通过Run on Server或其他任何地方添加新服务器。

#14


Not sure, but maybe your version of Eclipse does not support the latest Tomcat version? Try to update Eclipse. I have Eclipse 3.4 and there's no problem.

不确定,但是你的Eclipse版本可能不支持最新的Tomcat版本?尝试更新Eclipse。我有Eclipse 3.4,没有问题。

#15


I have been having the same problem (on fedora 9). You have to change the permissions of the files inside the tomcat conf directory to rw (chmod a+rw tomcat6/conf/*). Solved it for me!

我一直有同样的问题(在fedora 9上)。您必须将tomcat conf目录中的文件权限更改为rw(chmod a + rw tomcat6 / conf / *)。为我解决了!

#16


Window -> Options -> Server -> Runtime Environments

窗口 - >选项 - >服务器 - >运行时环境

Edit the existing runtime environment "Apache Tomcat v6.0" and select your tomcat's location.

编辑现有的运行时环境“Apache Tomcat v6.0”并选择tomcat的位置。

#17


I had the same problem, i use ubuntu 9.04 and tomcat 6.

我有同样的问题,我使用ubuntu 9.04和tomcat 6。

I installed the tomcat 6 for apt-get, installed also jre, jdk. (SUN)

我安装了tomcat 6 for apt-get,也安装了jre,jdk。 (太阳)

In order to resolve the problem do:

为了解决问题,请执行以下操作:

  • Close the Eclipse;
  • 关闭Eclipse;

  • Delete your workspace (save your files);
  • 删除工作区(保存文件);

  • stop the tomcat6 (/etc/init.d/tomcat6 stop)
  • 停止tomcat6(/etc/init.d/tomcat6停止)

  • make a link to conf (ln -s /var/lib/tomcat6/conf /usr/share/tomcat6);
  • 建立一个链接到conf(ln -s / var / lib / tomcat6 / conf / usr / share / tomcat6);

  • ln -s /var/lib/tomcat6/catalina.policy /etc/tomcat6/
  • ln -s /var/lib/tomcat6/catalina.policy / etc / tomcat6 /

  • init the eclipse
  • 初始化日食

  • In server tomcat configuration (/usr/share/tomcat6)
  • 在服务器tomcat配置中(/ usr / share / tomcat6)