• 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

Is it possible to run Tomcat from dos prompt if

 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you have NetBeans and Eclipse installed and running?
I'm trying to learn JSPs and Servlets from the Head First book but I'm having ALOT of trouble getting the tomcat to start up.
I don't want to change the Path but I think I have to in order to access the tomcat from dos prompt.
Any work around for this?
I want to keep my netbeans/eclipse configuration the same but maybe set up another tomcat to practice the examples in the book using dos prompt.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is and (in my humble opinon) it's a good idea.
I've never liked the idea of learning servlet programming in an IDE.

In order to have two copies of Tomcat running on the same machine, you need to change a couple port numbers. If everything in Netbeans is happy, don't disturb it.

Download the ".zip" version of Tomcat (assuming you're on a Windows machine) and unpack it. We'll call the directory it creates 'tomcat' (as apposed to apache-tomcat-5.5.blah blah..).
Open up tomcat/conf/server.xml and change the non-secure connector port from 8080 to something else like 8081.
Then, change the SHUTDOWN port from 8005 to something like 8006.

What you change them to is not really that important as long as nothing else is already using those ports.

Now, when you start up this version of Tomcat, you'll access it with:
http://localhost:8081
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
It is and (in my humble opinon) it's a good idea.
I've never liked the idea of learning servlet programming in an IDE.

In order to have two copies of Tomcat running on the same machine, you need to change a couple port numbers. If everything in Netbeans is happy, don't disturb it.

Download the ".zip" version of Tomcat (assuming you're on a Windows machine) and unpack it. We'll call the directory it creates 'tomcat' (as apposed to apache-tomcat-5.5.blah blah..).
Open up tomcat/conf/server.xml and change the non-secure connector port from 8080 to something else like 8081.
Then, change the SHUTDOWN port from 8005 to something like 8006.

What you change them to is not really that important as long as nothing else is already using those ports.

Now, when you start up this version of Tomcat, you'll access it with:
http://localhost:8081



so i don't have to touch the path at all?
won't i get "bin isn't recognized as internal or external command"?
when i was trying to do bin/startup.sh it wouldn't work
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You would still need to follow the instructions for installing and running Tomcat from the command line.

To make life easier, you could just install the '.exe' version and just start it from the Window,s Start menu (or as a Window's service). You would still want to change the ports in server.xml if you want to run both instances at the same time.
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
You would still need to follow the instructions for installing and running Tomcat from the command line.

To make life easier, you could just install the '.exe' version and just start it from the Window,s Start menu (or as a Window's service). You would still want to change the ports in server.xml if you want to run both instances at the same time.




i'm not sure if you answered the question about setting the path. will the exe file automatically set the path for me? and if so wouldn't it overwrite the path set for my IDEs?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jay Dilla:



i'm not sure if you answered the question about setting the path. will the exe file automatically set the path for me? and if so wouldn't it overwrite the path set for my IDEs?



The exe version doesn't rely on environment variables like PATH.
It saves its settings in the Window's registry.
It does use the JAVA_HOME environment variable (if set) as a hint when looking for your JDK but you can also browse for the JDK you want to use during the installation wizard.


Another approach (one that I use on Linux boxes all the time) is to put the environment settings inside the catalina.bat or (sh) file so the environment only exists for that copy of Tomcat.

For instance, on my machine I'm running Tomcat 5.5 with JDK 1.5 for maintaining our current version but for our upcoming release, we're developing on Tomcat 6 with JDK 1.6

To do this, I add all the export (set on Windows) commands to the top of catalina.sh (.bat on Windows). This way, I can have two copies of Tomcat running with different JDKs at the same time.
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks i'll do this when i get home
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
You would still need to follow the instructions for installing and running Tomcat from the command line.

To make life easier, you could just install the '.exe' version and just start it from the Window,s Start menu (or as a Window's service). You would still want to change the ports in server.xml if you want to run both instances at the same time.



where can I find this server.xml?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read the Tomcat documentation.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic