This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing files in subdirectories

 
Hama Kamal
Ranch Hand
Posts: 144
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Hama Kamal
Ranch Hand
Posts: 144
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 144
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...i tried it , but it fails.

Can you show us what exactly you tried, and your current directory?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic