• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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

 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic