Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 21 characters in body
Source Link
DJClayworth
  • 27k
  • 9
  • 59
  • 83

Since you specifically mentionThe bug you reference (bug 4787391 I assume) has been fixed in Java 8. Even if you are not satisfied withusing an older version of Java, the System.getProperty("user.home") functionalityapproach is probably still the best. Are you sure?
TheThe user.home approach seems to work in a very large number of cases. If you have read the bug page you will find that aA 100% bulletproof solution on Windows is hard, because Windows has a shifting concept of what the home directory means.

If user.home isn't good enough for you I would suggest choosing a definition of home directory for windows and using it, getting the appropriate environment variable with System.getenv(String).

Since you specifically mention bug 4787391 I assume you are not satisfied with the System.getProperty("user.home") functionality. Are you sure?
The user.home approach seems to work in a very large number of cases. If you have read the bug page you will find that a 100% bulletproof solution on Windows is hard, because Windows has a shifting concept of what the home directory means.

If user.home isn't good enough for you I would suggest choosing a definition of home directory for windows and using it, getting the appropriate environment variable with System.getenv(String).

The bug you reference (bug 4787391) has been fixed in Java 8. Even if you are using an older version of Java, the System.getProperty("user.home") approach is probably still the best. The user.home approach seems to work in a very large number of cases. A 100% bulletproof solution on Windows is hard, because Windows has a shifting concept of what the home directory means.

If user.home isn't good enough for you I would suggest choosing a definition of home directory for windows and using it, getting the appropriate environment variable with System.getenv(String).

Since you specifically mention bug 4787391 I assume you are not satisfied with the System.getProperty("user.home")System.getProperty("user.home") functionality. Are you sure? the user.home
The user.home approach seems to work in a very large number of cases. If you have read the bug page you will find that a 100% bulletproof solution on Windows is hard, because Windows has a shifting concept of what the home directory means.

If user.home

If user.home isn't good enough for you I would suggest choosing a definition of 'home directory'home directory for windows and using it, getting the appropriate environment variable with System.getenv(String)System.getenv(String).

Since you specifically mention bug 4787391 I assume you are not satisfied with the System.getProperty("user.home") functionality. Are you sure? the user.home approach seems to work in a very large number of cases. If you have read the bug page you will find that a 100% bulletproof solution on Windows is hard, because Windows has a shifting concept of what the home directory means.

If user.home isn't good enough for you I would suggest choosing a definition of 'home directory' for windows and using it, getting the appropriate environment variable with System.getenv(String).

Since you specifically mention bug 4787391 I assume you are not satisfied with the System.getProperty("user.home") functionality. Are you sure?
The user.home approach seems to work in a very large number of cases. If you have read the bug page you will find that a 100% bulletproof solution on Windows is hard, because Windows has a shifting concept of what the home directory means.

If user.home isn't good enough for you I would suggest choosing a definition of home directory for windows and using it, getting the appropriate environment variable with System.getenv(String).

Source Link
DJClayworth
  • 27k
  • 9
  • 59
  • 83

Since you specifically mention bug 4787391 I assume you are not satisfied with the System.getProperty("user.home") functionality. Are you sure? the user.home approach seems to work in a very large number of cases. If you have read the bug page you will find that a 100% bulletproof solution on Windows is hard, because Windows has a shifting concept of what the home directory means.

If user.home isn't good enough for you I would suggest choosing a definition of 'home directory' for windows and using it, getting the appropriate environment variable with System.getenv(String).