[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 507
  • Last Modified:

can't compile servlet, javac can't find servlet classes

when i try to compile a servlet file
with javac it can not find servlet classes for ex httpservlet
I already put classpath to tools.jar

and what should I do when this is done.
when I plase this class in my webdirectory (subdir servlets)
how to start it

0
d97adka
Asked:
d97adka
1 Solution
 
BillyAbbottCommented:
are you sure you have the servlet package?

type

javap javax.servlet.http.HttpServlet

if its on your classpath correctlythen you should get a list of its methods, if not it will return an error.

if it sin;t there, go to

http://java.sun.com/products/servlet/download.html#downloadsarchive

and download the servlet dev kit.
0
 
conickCommented:
Isnt the servlet jar file jsdk.jar??

If you are using the classpath variable make sure you set the full path and the jar file explicitly.
For example:
set classpath=%classpath%;c:\jsdk20\lib\jsdk.jar;

If you have JDK1.2 (Java 2) you can place all extensions in the extension directory.  This is located at:
c:\jdk12\jre\lib\ext\   (if jdk12 is your install directory)

I dont have a classpath set at all.
Every extension I have -- JMF,JSDK,even third party classes have their jar files located in this directory.  That way I can compile everything regardless of classpath setting.  This directory is actually checked FIRST before classpath.
See the Java Tutorial for more info:
http://java.sun.com/docs/books/tutorial/ext/index.html

Conick

0
 
d97adkaAuthor Commented:
Thanks
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now