wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes compiling with servlet-api Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compiling with servlet-api" Watch "compiling with servlet-api" New topic
Author

compiling with servlet-api

Yadu Shekhawat
Greenhorn

Joined: Dec 11, 2011
Posts: 4


Hi,
I'm using java 1.6 and tomcat 6.0 . I have made a servlet program in java and trying to compile it using the classpath as \programfiles\apachesoftwarefoundation\tomcat6.0\lib\servlet-api.jar . But still the servlet package cannot be found. Can someone help me with this.

Thanks
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

Are you missing a space in "program files"?

WP
Yadu Shekhawat
Greenhorn

Joined: Dec 11, 2011
Posts: 4

No, in command prompt writing javac -classpath \program files will not work. There cant be any spaces
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

The solution to that problem is not to leave out the spaces. That just means you refer to a directory which doesn't exist. The solution is to put quotes around paths which contain spaces.

The other solution is to put that jar file in a folder which doesn't have the problem with spaces.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

So you have a folder named "programfiles" ?

WP
Yadu Shekhawat
Greenhorn

Joined: Dec 11, 2011
Posts: 4

Did put quotes around the directory names with spaces but it gives
javac: invalid flag
Yadu Shekhawat
Greenhorn

Joined: Dec 11, 2011
Posts: 4

Well Paul with your advice i placed it in a directory without any spaces in its name and it worked :-)
Thanks
Thanks for your replies too William :-)
Paul Witten
Ranch Hand

Joined: Oct 10, 2012
Posts: 86
Paul Clapham wrote:The other solution is to put that jar file in a folder which doesn't have the problem with spaces.

That's when you know you're desperate to avoid Gatesisms.

Someday Desperate Java Programmers is going to supplant Desperate Housewives, I guaranteed it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: compiling with servlet-api
 
Similar Threads
Servlet DemoClass is not available
how to create tablespace in java dbms
What is need of JspPage, HttpJspPage interfaces in JSP
how to make a servlet to run at startup of the application
call a siebel webservice through java code(using servlet)