Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in the compilation of servlet

 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"classpath is not recognized as an internal or external command operable program or batch file" during compiling the servlet

in cmd as::
javac -classpath /tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on directly compiling the BeerSelect.java using javac it gives errors like ::

1. javax.servlet does not exist
2. javax.servlet.http does not exist
3. can not find symbol "class HttpServlet"
4. can not find symbol "class HttpServletRequest"
5.can not find symbol "class HttpServletResponse"
 
Gaurangkumar Khalasi
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivam singhal wrote:"classpath is not recognized as an internal or external command operable program or batch file" during compiling the servlet
in cmd as::
javac -classpath /tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/BeerSelect.java

For Windows 7:
From the desktop, right click the Computer icon.
Choose Properties from the context menu.
Click the Advanced system settings link.
Click Environment Variables. In the section User Variables, find the CLASSPATH environment variable and select it. Click Edit. If the CLASSPATH environment variable does not exist, click New.
In the Edit User Variable (or New User Variable) window, specify the value of the CLASSPATH environment variable(in your case, full path of the servlet-api.jar). Click OK. Close all remaining windows by clicking OK.
Restart the CMD and try again your task.

For more details ("How to on Linux, Windows XP, Solaris?") Click here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic