Reputation: 187
Totally new to java and and struggling.
I need to get the user preferred language
I did the following
Locale userPreferredLocale = Locale.getDefault() ;
However the above despite my Language being "da-DK" it always gets "en-GB"
so I tried the the following which I think will return the correct user language String locale = System.getProperty("user.language"); System.out.println("The Locale of the system is: "+locale);
However now I crash with java.security.AccessControlException: access denied (java.util.PropertyPermission user.language read) What do I need to do so that I have full rights? Do I need to create a file and put it somewhere ?
Can you help? Thanks
Upvotes: 1
Views: 4397
Reputation: 357
I don't know for sure, but what happens when you specifically run the program as root or administrator? Sometimes it isn't your code what causes the problem...
Upvotes: 1