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 Compiling java file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compiling java file " Watch "Compiling java file " New topic

Compiling java file

Divya Sanjeev

Joined: Dec 16, 2009
Posts: 18
Hi All,

I have a java file -- "" in this folder structure D:\examples\src
Also, there is a folder "classes" along with src in the same structure.
My question is, how do I make those .class files to get into "classes" folder using javac -d ??
Please help.

Thanks in advance,
Viktor Kubinec
Ranch Hand

Joined: Jan 28, 2012
Posts: 34
execute this from examples folder :
javac -d classes src/
Divya Sanjeev

Joined: Dec 16, 2009
Posts: 18
Thanks a lot Viktor.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46410
Why have you got that structure inthe first place? Are you using an IDE at this early stage? That is usually a mistake. Make yourself a “java” folder, as described here, and you can make subfolder as required. Using the folder structure from an IDE is a sure-fire recipe for confusion.
I agree. Here's the link:
subject: Compiling java file
jQuery in Action, 3rd edition