Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet utilities

 
jesse harris
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running jswdk and am trying to use a simple program to auto generate the doctype and title of the html to be generated. But each time i try to compile my servlets the compiler tells me it cannot find my utilities class, but I can see it there and I compileded it before I tried to compile my servlet.
my servlets and the utility prog are in package coreservlets and directory servlets/coreservlets. Do I need to point the compiler to the utility? or restart something? please, any help appreciated.
jesse
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To use a class from a package, The class must exist in a directory structure under the current working directory or under a path in your classpath. In your example, servlets should be the current working directory. The source files would both be in servlets/coreservlets To compile them the command line would be
javac coreservlets/Utility.java
javac coreservlets/YourServlet.java
Hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic