File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Need help in compiling programs 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 » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Need help in compiling programs" Watch "Need help in compiling programs" New topic

Need help in compiling programs

Puja Verma

Joined: Jul 01, 2006
Posts: 24
Hi friends....

I am getting problem in compiling my programs from command prompt in WINDOW Operating system.
I am giving :

C:\Program Files\Java\jdk1.5.0_06\bin>javac -classpath "C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar" -d classes C:\MyProjects\beerV1\src\com\example\web\

and output m getting :

C:\MyProjects\beerV1\src\com\example\web\ error while writing com.example.web.BeerSelect: classes\com\example\web\BeerSelect.class (The system cannot find the path specified)
public class BeerSelect extends HttpServlet {
1 error
Well I have directory structure as MyProjects\beerV1\classes\com\web and MyProjects\beerV1\src\com\example\web where i have put my servlet program.

Till now I have been using "IBM Web Studio Application Developer" for my application development.
But with that i am encountering problems in implement the JSTL ...taglibs programs..
So thot to use the general method to test programs.

Can you please help me ............

Impossible says I M Possible
Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 236
You are compiling from C:\Program Files\Java\jdk1.5.0_06\bin.
So you are saying that the class files should go to classes directory under the above.
Are you sure you have classes directory in C:\Program Files\Java\jdk1.5.0_06\bin ?
Mohd Fuzail
Ranch Hand

Joined: Feb 20, 2002
Posts: 107
Try executing it from C:\MyProjects\beerV1\ directory

Command will look likt

C:\MyProjects\beerV1>javac -classpath "C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar" -d classes src\com\example\web\

Being defeated is often a temporary condition. Giving up is what makes it permanent.
Puja Verma

Joined: Jul 01, 2006
Posts: 24
thanks... Mohd Fuzail and Surendra Nichenametla

I tried executing my program from C:\MyProjects\beerV1\ directory
and its working ......
It has created class file in the beerV1\classes\com\web, as desired.

Once again ...thanks for your help
I agree. Here's the link:
subject: Need help in compiling programs
jQuery in Action, 3rd edition