File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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: 42965
Did you try what Greg suggested?
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46412
. . . 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
jQuery in Action, 3rd edition