File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes maha please help - can't compile servlets! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "maha please help - can Watch "maha please help - can New topic
Author

maha please help - can't compile servlets!

eskay kumar
Ranch Hand

Joined: Jul 22, 2000
Posts: 71
Thanks maha for ur prompt reply! I was unable to post this as a reply to the earlier post - was facing some problem of submitting the post. so i had to post a fresh one.
I did as u told me. But i still get the same error - package import javax.servlet not found when i try to compile a servlet.
I can't seem to figure out what is wrong so - I have listed down the exact settings when i enter a set command on my dos prompt. You might be able to tell me if I'm missing something
c:\>set
TMP=c:\WINDOWS|TEMP
TEMP=c:\WINDOWS|TEMP
PROMPT=$p$g
winbootdir=c:\WINDOWS
COMSPEC=c:\WINDOWS\COMMAND.COM
PATH=c:\windows;c:\windows\command;c:\oracle\bin;c:\orawin95;c:jdk1.2.2\bin;;c:\Progra~1\Networ~1\MCAFEE~1
classpath=;c:\jdk1.2.2\lib\tools.jar; c:\Progra~1\jswdk\lib\servlet.jar
windir=c:\windows
Though I have set the enviornment variables TOMCAT_HOME and JAVA_HOME they don't get listed in the above, do I have to set them again each time i restart my PC i.e.
c:> set TOMCAT_HOME=c:\Progra~1\tomcat
c:> set JAVA_HOME=c:\jdk1.2.2
Thanks
shilpa !
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

when they don't show up it means something is worng in
your auotexec.bat.
could you post more details so we could help.
regds.
- madhav

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Shilpa,
I noticed one thing. First of all JAVA_HOME and TOMCAT_HOME are not set. It is very simple shilpa. Don't get frustrated. Remove all traces of jswdk related files from classpath. There is a servlet.jar file in c:\jakarta-tomcat\lib\servlet.jar dir. (assuming you have extracted the tomcat zip file in c:\ dir. When you unzip it automatically creates c:\jakarta-tomcat dir isn't? So put THIS c:\jakarta-tomcat\lin\servlet.jar in classpath. Do the exact procedure as Satya explaind here.
http://www.javaranch.com/ubb/Forum7/HTML/000598.html
Satya, Don't you think you have to add c:\jakarta-tomcat\lib\servlet.jar also in the 'set classpath...' line in autoexec.bat file if one wants to COMPILE SERVLETS also
So, Shilpa just add the c:\jakarta-tomcat\lib\servlet.jar also in the classpath with satya's procedure.
If possible you post your c:\autoexec.bat file also. We will find the culprit line
regds
maha anna
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Satya, Don't you think you have to add
c:\jakarta-tomcat\lib\servlet.jar also in the 'set classpath...'
line in autoexec.bat file if one wants to COMPILE SERVLETS also


In my case, I din't add it to the class path. Also one thing
I observed abt tomcat is it does some elaborate stuff to set
the classpath as it wants it to be. So I am guessing that if
we don't set it correctly, it does it for us, except the jdk
portion of the class path, which is a pre-requisite to running
tomcat. Hence IMHO, if we set our jdk portion of the class path
correctly, tomcat automatically adds all the dependency jar reqd
for tomcat to run.
Regds.
- satya
 
jQuery in Action, 2nd edition
 
subject: maha please help - can't compile servlets!