tags:

views:

150

answers:

2

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

A: 

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...

Bloeper
I am running as an Administrator
Jo
I have added the following to the Java.Policy but still get the same error permission java.util.PropertyPermission "user.language", "read, write"ANy suggestions?
Jo
A: 

rebooted the system and not sure makes sense but now It seems ok

Jo