aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Accessing files in subdirectories Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Accessing files in subdirectories" Watch "Accessing files in subdirectories" New topic
Author

Accessing files in subdirectories

Hama Kamal
Ranch Hand

Joined: May 29, 2011
Posts: 144

hi

when i want to compile a file in a subdirectory through command line i get

i'm in this path through command prompt C:\Users\hama.kamal\Desktop
the file that i want to access is in this path C:\Users\hama.kamal\Desktop\me\you which is named Test.java

i want to compile it in this way : javac me.you.Test.java but i get :-( any suggestion please?


``Worry does not empty tomorrow of its sorrow; it empties today of its strength.''
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3855

i want to compile it in this way : javac me.you.Test.java but i get

No, you can't compile like that. You have to use the "directory style" to point to the source file.

javac me\you\Test.java


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Hama Kamal
Ranch Hand

Joined: May 29, 2011
Posts: 144

Vijitha Kumara wrote:
i want to compile it in this way : javac me.you.Test.java but i get

No, you can't compile like that. You have to use the "directory style" to point to the source file.

javac me\you\Test.java


thanks Vijitha it compiles in that way but when i want to run in the same way it fails, java me\you\Test
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hama Kamal wrote:java me\you\Test

unlike javac, java expect . instead of \ . so use as in java me.you.Test
Hama Kamal
Ranch Hand

Joined: May 29, 2011
Posts: 144

Seetharaman Venkatasamy wrote:
Hama Kamal wrote:java me\you\Test

unlike javac, java expect . instead of \ . so use as in java me.you.Test


hi Seetharaman , i tried it , but it fails.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3855

...i tried it , but it fails.

Can you show us what exactly you tried, and your current directory?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing files in subdirectories