• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

error in the compilation of servlet

 
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
WARNING! Do not activate jet boots indoors or you will see a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic