File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes unable to use TOMCAT 5.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "unable to use TOMCAT 5.5" Watch "unable to use TOMCAT 5.5" New topic
Author

unable to use TOMCAT 5.5

nishant dahiya
Greenhorn

Joined: Aug 19, 2009
Posts: 15
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.
Bindu Lakhanpal
Ranch Hand

Joined: Oct 17, 2008
Posts: 171

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

Joined: Aug 19, 2009
Posts: 15
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

Joined: Aug 19, 2009
Posts: 15
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

Joined: Oct 17, 2008
Posts: 171

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

Joined: Aug 19, 2009
Posts: 15
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

Joined: Oct 17, 2008
Posts: 171

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

Joined: Aug 19, 2009
Posts: 15
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

Joined: Oct 17, 2008
Posts: 171

if you have vista then i can tell you.
check this out.
webpage
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61755
    
  67

Moved to the Tomcat forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61755
    
  67

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

Joined: Oct 17, 2008
Posts: 171

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"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to use TOMCAT 5.5