aspose file tools*
The moose likes Beginning Java and the fly likes error in the compilation of servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "error in the compilation of servlet" Watch "error in the compilation of servlet" New topic
Author

error in the compilation of servlet

shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 226

"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

Joined: Jul 15, 2012
Posts: 226

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

Joined: Jun 02, 2012
Posts: 187
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error in the compilation of servlet