aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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

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

venki sheshgiri

Joined: Jan 01, 2006
Posts: 28

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[]){

Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

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:
subject: System.getProperty("user.dir") not fetching the expected value.
Similar Threads
specify relative path in File constructor
Execution of command "java -version" takes much time on AIX machine with AIX JDK 6
migrate program from unix to windows, confuse about Path
How do I get the relative path if the user selects a file in a JFileChooser?