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 problem with using javac -d ? 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 "problem with using javac -d ?" Watch "problem with using javac -d ?" New topic

problem with using javac -d ?

shoeb sayyed
Ranch Hand

Joined: Mar 14, 2010
Posts: 48
the structure of my files are as follows



i want to have .class file to be stored in E:\AqanTech\WebApp1\WEB-INF\classes\ after compilation

i am trying to compile it using javac -d .\classes ..\src\*.java while i am in E:\AqanTech\WebApp1\WEB-INF\src

it gives me an error which is attached in the file

Can you please help me with that?

[Thumbnail for t1.JPG]

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45338
Please copy and paste your error messages.
On Windows:
  • click the top left icon on the command prompt
  • select edit from the drop down list
  • select mark
  • highlight the code with your mouse, remembering to highlight the whole length of the lines
  • use the enter key to copy
  • past the text onto the JavaRanch windows.
  • shoeb sayyed
    Ranch Hand

    Joined: Mar 14, 2010
    Posts: 48
    E:\AqanTech\WebApp1\WEB-INF\src>javac -d .\classes ..\src\*.java
    ..\src\ error while writing S1: .\classes\S1.class (The system cannot
    find the path specified)
    public class S1 extends HttpServlet

    I just pasted the error from the command Prompt Window

    please someone help me with this?
    Marco Pacini

    Joined: Mar 16, 2010
    Posts: 5
    Try to compile it using "javac -d E:\AqanTech\WebApp1\WEB-INF\classes\ *.java" while you are in E:\AqanTech\WebApp1\WEB-INF\src.
    Rob Spoor

    Joined: Oct 27, 2005
    Posts: 20193

    Add the JAR file that includes the servlet classes (servlet-api.jar?) to your class path when compiling as well as the classes folder:

    SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
    How To Ask Questions How To Answer Questions
    I agree. Here's the link:
    subject: problem with using javac -d ?
    It's not a secret anymore!