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!

Windows: problem retrieving location of user's application data directory

843798Sep 14 2010 — edited Sep 15 2010
Hi Community,

I have some problems retrieving the path location of the user's application data directory.

The common approach which does not work is to execute
path = System.getenv("APPDATA");
The problem is that this code does not work when someone start the process via "Run As". In such a case the %APPDATA% environment variable is not present.

Does someone know a clean way to retrieve the appdata directory location on Java6?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 13 2010
Added on Sep 14 2010
6 comments
666 views