Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Java question

  • 05-09-2001 11:04PM
    #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