• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compiling with servlet-api

 
Yadu Shekhawat
Greenhorn
Posts: 4
Java Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you missing a space in "program files"?

WP
 
Yadu Shekhawat
Greenhorn
Posts: 4
Java Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, in command prompt writing javac -classpath \program files will not work. There cant be any spaces
 
Paul Clapham
Sheriff
Pie
Posts: 20719
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have a folder named "programfiles" ?

WP
 
Yadu Shekhawat
Greenhorn
Posts: 4
Java Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did put quotes around the directory names with spaces but it gives
javac: invalid flag
 
Yadu Shekhawat
Greenhorn
Posts: 4
Java Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic