This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
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"
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