• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

"bad class file: .\LogServlet.java" error

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I've upgraded my existing version of MySQL and can run Test.java, and TestServlet.java extends HttpServlet, but when I try TestServlet.java extends LogServlet I get the following errors:
"C:\javaranch>javac TestServlet.java
.\LogServlet.java:7: package LocalSystem does not exist
import LocalSystem.* ;
^
TestServlet.java:5: cannot access LogServlet
bad class file: .\LogServlet.java
file does not contain class LogServlet
Please remove or make sure it appears in the correct subdirectory of the classpath.
public class TestServlet extends LogServlet
^
2 errors"
I've tried adding c:\javaranch\JavaRanchCommon.zip; to the classpath, but it makes no difference; JavaRanchCommon.zip is in c:\javaranch and it does have LocalSystem.class in the root.
Does anyone have any suggestions?
LogServlet certainly used to work OK
All the best,
Kate!!
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kate, I couldn't find the LocalSystem.class in my JavaRanchCommon.zip. Then I did a search and it seems this thread may address your problem. Try download the JavaRanchCommon.zip and see if it helps.

Joyce
[ August 05, 2004: Message edited by: Joyce Lee ]
 
Kate Head
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that Joyce.
After reading the thread, and relooking at the error message, I thought I'd do a check and see what .java files I had in my "working" directory - and there was LogServlet.java (I'd extracted it while doing Servlets 5 and hadn't removed it)
I deleted it and now everything compiles without problem - and runs OK as well. Phew!
All the best,
Kate!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!