Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java question

Options
  • 06-09-2001 12:04am
    #1
    Closed Accounts Posts: 286 ✭✭


    in a java program how do you find out the path of the directory where the program is run from i.e. the class file, the current working directory is always the location of the java.exe program.


Comments

  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    Try this:
    String currentDirectory = System.getProperty("user.dir");
    
    

    Failing that you could specify resources in a properties file. The above should work though.


Advertisement