Hello ranchers i am very new to servlets. I have jdk1.5 installed in my pc along with Sun Studio EnterpriseEdition Whenever i try to compile my code (having import javax.servlet.*) from command prompt, it gives a compiler error of above package not found. Whereas my normal corejava codes compiles fine.Kindly tell me how to get the package in the path
you need to install tomcat5.0 and j2ee 1.5 sdk as well. then set the eviroment variables as follows; (note that this is relative to where i have installed the relevant applications)
J2EE_HOME - C:\Sun(where you install the j2ee sdk) JAVA_HOME - C:\Sun\AppServer\jdk(where you have installed the j2se jdk) PATH - "C:\Sun\AppServer\bin";"C:\Sun\AppServer\jdk\bin";"C:\Sun\AppServer\lib\ant\bin";%PATH% thats about it... after that just compile your code from the command promt and check... hope this helped.
if who i am is what i have, and what i have is lost, then who am i?<br /> <br />SCJP 5.0<br />SCWCD 1.4<br />SCBCD preparing
i think the edition you are using doesn't contain classes which are necessary for servlets.
download jsdk2.1 and set
On windows system :
classpath to rootdirectory:\jsdk2.1\servlet.jar;rootdirectory:\jsdk2.1\server.jar
Example : classpath is D:\jsdk2.1\servlet.jar;D:\jsdk2.1\server.jar; classpath is an user defined environment variable. if it is not present then create it.
now after setting this compile your servlet.i think it must work.
i think i answered your question properly and this is the first reply for a question in this community.
Originally posted by Abhinav Pandey: Hello ranchers i am very new to servlets. I have jdk1.5 installed in my pc along with Sun Studio EnterpriseEdition Whenever i try to compile my code (having import javax.servlet.*) from command prompt, it gives a compiler error of above package not found. Whereas my normal corejava codes compiles fine.Kindly tell me how to get the package in the path
All you need is your servlet library on your classpath. Typically servlet.jar or servlet-api.jar.
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
posted
0
Originally posted by bhagavatula indu sekhar: download jsdk2.1
??
Moreover, SDK doesn't, typically, include servlet library.
Originally posted by Adeel Ansari: Moreover, SDK doesn't, typically, include servlet library.
JSDK -as opposed to the any of the Java SE/EE SDKs- used to be short for "Java Servlet Dev Kit", and it did include the jar files. But the term JSDK was dropped a while ago. The servlet jars are now available here, or as part of a Tomcat installation. [ November 08, 2006: Message edited by: Ulf Dittmer ]