This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes classpath problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "classpath problem" Watch "classpath problem" New topic

classpath problem

Rahul Sudip Bose
Ranch Hand

Joined: Jan 21, 2011
Posts: 637

I am unable to compile a simple servlet. I think that it is because of my classpath.

I have set the classpath for tomcat in "environment variables". Now, i want to compile my java file which is in R drive and uses :-
>tomcat jar files which are in C drive.
>a class "BeerSelect" in my project folder - R:\MyProjects\beerV1\src\com\example\web

here is the problem in compiling :

My directory structure for the project :

Please help me to overcome this problem.

SCJP 6. Learning more now.
Greg Brannon

Joined: Oct 24, 2010
Posts: 563
Part of the problem is with your javac command line. Spaces are interpreted as breaks between command line arguments. I believe you have to surround an argument that includes spaces with quotes.

Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Rahul Sudip Bose
Ranch Hand

Joined: Jan 21, 2011
Posts: 637

how can i correct it ?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
Did you try what Greg suggested?
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45307
. . . and it is usually does more harm than good to set a classpath system environment variable, unless there was something already set by another application.
I agree. Here's the link:
subject: classpath problem
It's not a secret anymore!