• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

unable to use TOMCAT 5.5

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i install the tomcat 5.5 today and set the environment variables JAVA_HOME and TOMCAT_HOME to C:\Program Files\Java\jdk1.5.0_05\bin , C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin respectively. After that i tried try to run the first program given in Head First Servlets and JSP at page no.30 by building the same directory structure as given in book i.e D:\java\SCWCD\project1 and where project1 contains src , classes and etc directories. Inside src i put Ch1Servlet.java and web.xml in etc.
after that i build the structure C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ch1\WEB-INF\classes and then try to run my javac command from COMMAND PROMPT which is javac -cp C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar -d classes src\Ch1Servlet.java from D:\java\SCWCD\project1
directory but that shows the mesg invalid flags Files\Apache and if i remove the spaces in between the javac command path it gives the error that javax.servlet package do not exist and some others. As i just started studying HFS n JSP so kindly help me out if you know the solution.
 
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tell you my settings which are working for me

JAVA_HOME: C:\Program Files\Java\jdk1.6.0_04

classpath: C:\Program Files\Java\jdk1.6.0_04;.;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\jsp-api.jar

path:C:\Program Files\Java\jdk1.6.0_04\bin;.;

 
nishant dahiya
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bindu Lakhanpal wrote:I tell you my settings which are working for me

JAVA_HOME: C:\Program Files\Java\jdk1.6.0_04

classpath: C:\Program Files\Java\jdk1.6.0_04;.;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\jsp-api.jar

path:C:\Program Files\Java\jdk1.6.0_04\bin;.;


did you use the same command as given in the HFSJ for compiling the Ch1Servlet.java file
 
nishant dahiya
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i hv done all the changes YOU told bt still its giving the same message i.e invalid flags Files\Apache
CAN SOMEBODY HELP PLEASEEEEE :banghjavascript:emoticon('');ead:
oK can you tell me how can i check that my Apache Tomcat is working fine that is may be there is an error in Apache Tomcat. Also when i click on Configure Tomcat Option to start Tomcat it gives Error: Access Denied
 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

did you use the same command as given in the HFSJ for compiling the Ch1Servlet.java file



No, as i have set the classpath (C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;),so i do not use the javac -cp C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar -d classes src\Ch1Servlet.java
but just javac -d classes src\Ch1Servlet.java

For checking whether Tomcat is working or not you can try to run the example programs given in webapps
First start Tomcat and the in browser type http://localhost:8080/ then a tomcat welcome screen appears. In that click on Tomcat manager.

That what i do.Even i am new to these things.
I hope it helps you.
 
nishant dahiya
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but i am finding no options to find start Tomcat ,i know this is a foolish kind of thing to ask bt if you can tell then it will of great help.
 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.I know how it pains when you can't start tomcat.
I have vista so i was having great difficulty initially.
I have installed service version of Tomcat 6 ( apparantaly only it works on vista).
you are using Tomcat 5..i guess there mus tbe a bin directory in which you can find some executive files to start and stop tomcat.
Better type your question in search facility in Tomcat forum.
 
nishant dahiya
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
same here i also have vista and an exe file in bin but when started it gives some kind of error which i cant understand , better would be if i paste it on Tomcat Forum thank you for your suggestions
 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you have vista then i can tell you.
check this out.
webpage
 
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Tomcat forum.
 
Bear Bibeault
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compiling your servlet has nothing to do with Tomcat (except for making sure that the servlet and JSP API jar files are in the classpath).

Your compilation woes stem from the spaces in the folder names. I haven't used Windows in years so I don't remember the notation to use to allow the spaces to be used (perhaps try quoting the paths), but the command line is failing due to those spaces.

By the way, the harder you make your posts to read, the fewer people will try to help you. Red text is hard to read. Big blocks of text with no paragraphs are hard to read. Putting a bunch of badly formed smilies in your post makes it hard to read. Not using code tags makes it hard to read. Get the picture?
 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Your compilation woes stem from the spaces in the folder names



I agree. I remember when i used command line classpath setting as given in HFSJ i had to put the names with spaces in quotes like "Program files"
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!