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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 36592
    
  16
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.
 
jQuery in Action, 2nd edition
 
subject: Compiling java file
 
Similar Threads
classpath issue?
How to use relative directory locations when compiling?
Please explain this - compiling java file
Unable to access classes in a jar file
Package Problem