开发者

What steps are necessary to get Eclipse and a Java servlet container integrated on Ubuntu 9.10?

What's the easiest way for me to get Eclipse running with a Java servlet container on Ubuntu 9.10?

I've tried a number of things, hitting dead ends each time. The best setup would use Ubuntu packages as much as possible, not require running Eclipse as root, and be able to debug running servlets.

Dead ends so far include run-jetty-run, the Sysdeo Tomcat plugin, and Eclipse WTP with tomcat6.

A big part of the problem is that the Ubuntu tomcat6 installation is non-standard, splitting directories such that they're not all in TOMCAT_HOME. Eclipse is also non-standard, a开发者_JAVA技巧nd the usual plugin installation methods don't work. I got close by installing the WTP through a PPA, but I stumbled when trying to get it to recognize tomcat.


Ubuntu recently includes a pretty full Eclipse package that you can install via Synaptic or such. But I prefer to download my own.

I download from the Eclipse download site. If I choose Eclipse IDE for Java EE Developers then I have server environments for all Web app containers already built in. If I set up one for Tomcat (in Eclipse), Eclipse will download and install Tomcat for me. It's quite convenient, although I sometimes have trouble finding Tomcat or its files. Eclipse squirrels them away somewhere.

The server setup menus become accessible to you once you create a Web project (not plain Java project).


You should "apt-get install sun-java6-jdk", download and use the Java EE version of Eclipse, and then create a dynamic web project. In the web project create a jsp page, and right click -> "Run -> Run on server" where you may then install a server connector.

Some connectors are included in Java EE, some must be downloaded. Choose the one corresponding to the server you have downloaded and unpacked, and point Eclipse to the directory.

If all succeedes, the JSP page should then show up in a browser served from the started server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜