I am currently self-studying servlets. It has been cakewalk so far.
I compile my Java programs from command line and I have set the classpath environment variable to D:\Program Files\apache-tomcat-7.0.35-windows-x86\apache-tomcat-7.0.35\lib\servlet-api.jar
so that I do not have to keep entering it over and over again.
However,
my development environment and deployment environment are in different locations (duh). Every time I have to start Tomcat I have to navigate to the bin folder and then call STARTUP.BAT
This is quite annoying.
My question is:
Is there a way so that I can start Tomcat right from the directory where my Java sources are stored ? and avoid the hassle of navigating all the time ?
Something akin to:
E:\Servlet Projects\Project-1\src > startup.BAT and Tomcat would start
Misc:
Just add the path to Tomcat’s bin folder to
pathenvironment variable. If a batch/command file is not found in the current folder, then the operating system will look for the file in all paths definied in thepathenvironment variable, in the same order as they’re been definied.Note that this all has completely nothing to do with Java, Servlets, nor Tomcat.