This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am using apache-tomcat server and I have already set classpath and Jdk path by environment variable. When I'm compiling my servlet as
C:>cd Users\him\applications\tomcat 5.5\webapps\myproject
c:>javac -classpath "Users\him\applications\tomcat 5.5\common\lib\servlet-api.jar";classes:. -d classes src\com\example\web\MyServlet.java
I am using apache-tomcat server and I have already set classpath and Jdk path by environment variable
If you have already set the classpath then why are you still refering it during compilation. Its better to remove it from environment variable or to remove it from your compilation command. (Here i am talking about the servlet-api.jar)
In general during these situations the best way to setup an environment is to use a .bat, .cmd or a .sh file and set everything in that rather than messing up with the environment variable. In that way you have better control over the current command prompt.