aspose file tools*
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
Author

Compiling java file

Divya Sanjeev
Greenhorn

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

I have a java file -- "Hello.java" 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,
Divya
Viktor Kubinec
Ranch Hand

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

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

Joined: Oct 13, 2005
Posts: 39876
    
  28
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: http://aspose.com/file-tools
 
subject: Compiling java file