This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates 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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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:


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