Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuration problem

 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i went through the tutorial given in http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Download-Tomcat to configure tomcat. but the thing is only the .html files work and the .jsp files dont work. i downloaded the j2ee 1.5 sdk. after downloading it i set the class path to java/jdk. now the tomcat server is running but the javac command is not working. there is this HelloServlet.java file that i got from the site that im trying to compile. but when i do try to compile still it gives errors saying can not find import javax.servlet.*; & import javax.servlet.http.*; . i know these are packages from the j2ee but i did install j2ee. can anyone help me with this?


thank you.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll find these jars in Tomcat's common/lib directory.
 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the thing is i have set the classpath to those directories as given in the site i mentioned above. the thing is the problem with the compiler. when i compile it says it can not find the package names i mentioned earlier. i have installed j2ee 1.5. is it a problem with that? it came with something called sun application server. is that the problem? please help as im very new to j2ee technology.

thank you.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not the directory you have to set in the classpath, but the jar files, especially servlet-api.jar.
 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have done that. my enviroment variables are set as follows;

CLASSPATH = .;C:\apache-tomcat-5.5.17\apache-tomcat-5.5.17\common\lib\servlet-api.jar;C:\apache-tomcat-5.5.17\apache-tomcat-5.5.17\common\lib\jsp-api.jar;C:\Servlets+JSP
JAVA_HOME = C:\Program Files\Java\jdk1.5.0_02
PATH = "C:\Program Files\Java\jdk1.5.0_02";%PATH%


but still its not working. why is that?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You did fine. You're compiling at the command prompt, right ?
On the command prompt, try the following :


dir C:\apache-tomcat-5.5.17\apache-tomcat-5.5.17\common\lib\servlet-api.jar
 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did what you told me to do. i got the following result.

C:\>dir C:\apache-tomcat-5.5.17\apache-tomcat-5.5.17\common\lib\servlet-api.jar
Volume in drive C has no label.
Volume Serial Number is B800-EE64

Directory of C:\apache-tomcat-5.5.17\apache-tomcat-5.5.17\common\lib

04/14/2006 02:09 PM 97,703 servlet-api.jar
1 File(s) 97,703 bytes
0 Dir(s) 6,121,197,568 bytes free

what next? its still not working. i have set the class path to the j2se5.0 folder. but i also installed j2ee sdk as well because it didnt work before. do i need to set the class path to the j2ee sdk? if so to which path?
 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also now its saying that javac is not a recognized command when i type it in the command line.

please help

thank you
 
Vikrant Pandit
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dinuka,

Setting your path to

PATH = "C:\Program Files\Java\jdk1.5.0_02\bin";%PATH%

will resolve the problem of javac being not a recognized commands

HTH
 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks everyone. it was my mistake. i havent correctly configure the j2ee sdk and the ANT_HOME enviroment variables. thats why it didnt work. now its ok. again i want to thank everyone for helping me.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic