Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Java question

  • 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