How do I set CLASSPATH variable for Tomcat in 12.10?
The CLASSPATH
variable can be extended in this way
CLASSPATH=${CLASSPATH}:/path_to_classes_dir
or
CLASSPATH=${CLASSPATH}:/path_to.jar
But I think your question is not reflecting your right intention.
servlet-api.jar
is an api. It is only needed at compile time.
On run time an implementation is provided by a container like tomcat.
Related videos on Youtube
An SO User
Updated on September 18, 2022Comments
-
An SO User over 1 year
Previously, I have set the
JAVA_HOME
path using the terminal with the following command:export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-i386" >> ~/.bashrc
Now, I want to set the
CLASSPATH
environment variable to include theservlet-api.jar
. Basically, what I am trying to achieve is that I should not need to type the classpath toservlet-api.jar
every time I compile a Java program nor should I have to type-cp .
when compiling a regular Java program whose.class
file is in the same directoryI am a newbie from Windows so please a step-by-step guide would be appreciated!