aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Configure Tomcat in Eclipse (in mac) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Configure Tomcat in Eclipse (in mac)" Watch "Configure Tomcat in Eclipse (in mac)" New topic
Author

Configure Tomcat in Eclipse (in mac)

Ilakya Mukunth
Ranch Hand

Joined: Mar 13, 2012
Posts: 57
Hi,
I am NEW to java. I am learning java. So I installed eclipse, configured jdk and able to run java programs from eclipse. I have started learning JSP and servlets. I installed tomcat. I do not know how to configure my webapps folder and enable tomcat server in eclipse. I want to edit and run HTML, XML, JSP,JS and servlets from eclipse. I am using mac book pro (snow leopard).
Your earlier response would be helpful to me. Its kind of work stopped to me. I am unable to proceed further studying without knowing this setup.
Thanks in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Personally I don't run Tomcat in the IDE -- I run a standalone instance. I think that it's easier to manage and more closely resembles the deployment environment.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
If you search for "integrating tomcat with eclipse" you will find many useful links. Basic things will be configuring a Tomcat server runtime in Eclipse and making the web project run on the configured server.
Ilakya Mukunth
Ranch Hand

Joined: Mar 13, 2012
Posts: 57
@Bear Bibeault Thanks for the help.
I am finding it more difficult to edit,create new JSP, HTML, Servlets and .java files separately in text editor. Compiling the servlets in terminal is time consuming. I wanted to use eclipse to edit these files.
Please let me know,
1. I would like to know how to import the webapps project in eclipse
2. how to configure tomcat sever from eclipse.
3. how to run servlets in eclipse

Since I am learning the basics now, step by step help would be appreciable.

Thanks
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Most things in Eclipse are straightforward *IF* you follow the prompts and read carefully.

1. New -> Project -> Import Existing Project
(Must have a .project file in project root folder, or else create a new one)

2. Server -> New -> tomcat
(Point to your Tomcat installation folder)

3. Servlets don't run in Eclipse, they run in Tomcat or another J2EE container (e.g: JBoss)
(Once your project is built and deployed (or published) to your server, they will run in there)

As Bear said, there are plenty of tutorials, examples, walk-throughs, even youtube videos out there.

Search is your friend.


WP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Ilakya Mukunth wrote:@Bear Bibeault Thanks for the help.
I am finding it more difficult to edit,create new JSP, HTML, Servlets and .java files separately in text editor.

I did not say that I do not use an IDE for editing. In fact, I use IntelliJ. What I do not do is to run Tomcat in the IDE.

Compiling the servlets in terminal is time consuming.

It's easy to configure the IDE to write the class file in the right place. And you can use Ant at the command line if you desire.

I wanted to use eclipse to edit these files.

What's stopping you?

This is just how I work and I find it a lot easier than fighting with running Tomcat in the IDE and the limitations that imposes. Your mileage may vary.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16303
    
  21

Bear Bibeault wrote:Personally I don't run Tomcat in the IDE -- I run a standalone instance. I think that it's easier to manage and more closely resembles the deployment environment.


That's why I hate the standard WTP plugin - it totally mucks around with the Tomcat environment. Badly. And incompletely.

On the other hand, I do use the sysdeo plugin, since it almost totally replicates production servers using the same config files as Tomcat does when running stand-alone. The only significant difference being that instead of logging to catalina.out, the tomcat stdout/stderr stream gets redirected to the Eclipse console window. Usually that's a difference that makes no difference. For rare cases when it doesn't (meaning that the whole Tomcat setup is messed up), that's when I run Tomcat stand-alone.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ilakya Mukunth
Ranch Hand

Joined: Mar 13, 2012
Posts: 57
Thanks a lot for your help. I am able to configure tomcat in eclipse. The installed java development IDE. then I reinstalled eclipse for J2EE develoment ide. and i was able to run the servlet.
Thanks alot. once again.
I am writing a servlet to download a jar file. Its throwing null pointer exception.This is the code snippet

GetFile.html


GetFile.java
========

web.xml
======


Please help me to resolve this issue

Thanks in advance
Ilakya Mukunth
Ranch Hand

Joined: Mar 13, 2012
Posts: 57
Hi there,
Please let me know how to resolve the issue.

thanks in advance,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configure Tomcat in Eclipse (in mac)