Hi , I am using tomcat and have setup the classpath in PATH enviroment variable to the servlet-api.jar file. Whenever i compile my javaservlet code i get import javax.GenericServlets not found . Though if I compile code using -classpath "path to servlet api" while compiling code it compiles successfully.
What i am doing wrong while setting up the PATH variable?
2) javax.GenericServlets is not a class, nor does the "javax" package actually have any classes in it. Or was that just a copy/paste error?
I am sorry that was typo error
import line is aactually import javax.servlet.*
PATH has nothing to do with the classpath. CLASSPATH does, though, although I don't recommend using it.
Then what is the solution?
posted 2 years ago
If compiling using - classpath works, I don't think anything needs to be done.
Since the number of external libraries in your projects is likely to increase over time (which makes typing in command line arguments tiresome), you may want to look into build tools like Ant, Maven and Gradle.