This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Configure Tomcat in Eclipse (in mac)

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • 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.
 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • 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: 21128
131
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi there,
Please let me know how to resolve the issue.

thanks in advance,
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!