This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes System.getProperty( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "System.getProperty("user.dir") not fetching the expected value." Watch "System.getProperty("user.dir") not fetching the expected value." New topic
Author

System.getProperty("user.dir") not fetching the expected value.

venki sheshgiri
Greenhorn

Joined: Jan 01, 2006
Posts: 28
Hi

the below SOP is returning "." in an AIX machine , whereas I'm expecting the absolute path any Idea how/from where JVM fetches this value in a AIX machine.


public class aaa{
public static void main(String args[]){
System.out.println(System.getProperty("user.dir"));
}
}

Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Where that value comes from is platform-specific, but certainly "dot" is not a particularly useful result. I don't know why it would do that, but if your main concern it just getting a meaningful value, you could try something like this:


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: System.getProperty("user.dir") not fetching the expected value.
 
Similar Threads
Execution of command "java -version" takes much time on AIX machine with AIX JDK 6
WorkingDirectory
How do I get the relative path if the user selects a file in a JFileChooser?
migrate program from unix to windows, confuse about Path
specify relative path in File constructor