#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    18
    Rep Power
    0

    Where is the correct place to save my .java files if i want to compile them?


    Where is the right place to save my .java files if i want to compile them? I have my first one saved on my desktop and i keep getting the same error. I think it may be because of my directory which i don't know a lot about. Is there a place on my mac where my .java files will be more easily recognized by the compiler (javac)? Thanks for the help.
  2. #2
  3. Java Junkie
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2004
    Location
    Mobile, Alabama
    Posts
    4,022
    Rep Power
    1285
    Just save them in a particular location and then in a terminal, go to the location.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    18
    Rep Power
    0
    Originally Posted by bullet
    Just save them in a particular location and then in a terminal, go to the location.
    alright i have that saved onto my desktop and when i write in terminal javac helloworld.java i get:


    javac: file not found: helloworld.java
    Usage: javac <options> <source files>
    use -help for a list of possible options

    what could be the problem?
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Location
    London, ON
    Posts
    322
    Rep Power
    214
    did you navigate to the directory?

    Code:
    cd C:\Users\$username\desktop
    javac helloworld.java
    <Tetrad> the program I just wrote 1) compiled the first time without any errors and 2) worked like it was supposed to
    <Tetrad> I don't know whether to be proud or scared to death
    Originally Posted by DaWei_M
    That covers a multitude of your sins, right there.
  8. #5
  9. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,692
    Rep Power
    1958
    You didn't get it to work?

    Comments on this post

    • Wetmelon agrees : Looks like he got it to work in the other thread. Doublepost :(

IMN logo majestic logo threadwatch logo seochat tools logo