• 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

JSP : Cannot find symbol

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys, I am trying to execute the servlet program for listener example give in Head First Book. I have placed all the java files (Dog, ListenerTester and MyServletContextListener) in the same path. Dog class is getting compiled successfully but the other two classes are showing the "Cannot find symbol(Dog)" error. Dog class is public but still it's not able to recognize it while compiling. I am compiling the file in CMD using the following command :
javac -classpath C:\apps\apache-tomcat-5.5.34\common\lib\servlet-api.jar -d classes "C:\Documents and Settings\372162\My Documents\J2EE_Practice\MyProjects\listener-Ex\src\com\example\web\ListenerTester.java"
 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your Dog in the classpath?
 
Harish V Gupta
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's working now. I was not including the Dog.class's path in the classpath. It worked with the following command :
javac -classpath "C:\apps\apache-tomcat-5.5.34\common\lib\servlet-api.jar;C:\Documents and Settings\372162\My Documents\J2EE_Practice\MyProjects\listener-Ex\classes" -d classes "C:\Documents and Settings\372162\My Documents\J2EE_Practice\MyProjects\listener-Ex\src\com\example\web\MyServletContextListener.java"
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic