• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Configure Tomcat in Eclipse (in mac)

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@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
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ilakya Mukunth
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
Please let me know how to resolve the issue.

thanks in advance,
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic