• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Configuration problem

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic