• 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

Cannot find symbol

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two java files here: D:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\MyApp\WEB-INF\classes\com\example\web
First: Dog.java
Second: Login.java

I am trying to compile from classes directory using the command:
D:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\MyApp\WEB-INF\cla
sses>javac -classpath "D:\Program Files\Apache Software Foundation\Tomcat 8.0\li
b\servlet-api.jar" com/example/web/Dog.java


[This one gets compiled without any problem]

For the other file:

D:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\MyApp\WEB-INF\cla
sses>javac -classpath "D:\Program Files\Apache Software Foundation\Tomcat 8.0\li
b\servlet-api.jar" com/example/web/Login.java

com\example\web\Login.java:39: error: cannot find symbol
Dog dog = (Dog) getServletContext().getAttribute("dog");
^
symbol: class Dog
location: class Login
com\example\web\Login.java:39: error: cannot find symbol
Dog dog = (Dog) getServletContext().getAttribute("dog");
^
symbol: class Dog
location: class Login
2 errors

Both the files are in the same directory.

Dog.java


Login.java

 
reply
    Bookmark Topic Watch Topic
  • New Topic