Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

System.getProperty("user.dir") returns "/home/user" on Linux

800449May 6 2007 — edited May 7 2007
Has anyone else had the error when launching a jar from Linux (just by clicking it), System.getProperty("user.dir") returns the "/home/user" (or "~") value instead of the folder that the jar is in? Essentially, it returns "user.home" instead of "user.dir".

This does not happen when I start the application from command line.

(I know its not swing, but I wasn't sure where to post it)

Is this just a simple Linux setting that isn't enabled by default? Ubuntu already made the file association after using apt-get to install Java 6.

Cheers.

-FBL
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2007
Added on May 6 2007
2 comments
1,996 views