Results 1 to 2 of 2
  1. #1
    Ashley is offline Member
    Join Date
    May 2007
    Posts
    2
    Rep Power
    0

    Default How can i get current directory?

    I was wondering if there was a way to get the directory the java application is running from?

  2. #2
    levent Guest

    Default

    You can use this:

    Java Code:
         String currentDir = new File(".").getAbsolutePath();
    or this:

    Java Code:
         System.getProperty("user.dir")

Similar Threads

  1. Static function to get current working directory
    By Java Tip in forum Java Tip
    Replies: 1
    Last Post: 06-23-2008, 03:13 AM
  2. How to get Current Directory through File
    By Java Tip in forum java.io
    Replies: 0
    Last Post: 04-05-2008, 11:14 AM
  3. Current month
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-07-2008, 09:40 AM
  4. Getting current userís name
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-07-2007, 01:04 PM
  5. How to get the current working directory in EJB?
    By sathish_2111 in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 07-19-2007, 05:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •