JDK-7112015 : REGRESSION:wrong default-locale in java 7
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2011-11-15
  • Updated: 2012-03-20
  • Resolved: 2011-11-16
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) Client VM (build 21.1-b02, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
windows-installation: english
regional and languages options: German (Austria) and Location: Austria


A DESCRIPTION OF THE PROBLEM :
The default-locale reported by java 7 is en_US (wrong).
The default-locale reported by java 6 is de_AT (correct).

Almost all programs honor the regional-settings and have their menus, etc. in german - not so programs running with Java 7.

I know about bug 7073906 and don't think it is a duplicate of that.

It is an incompatible change:

1) To change the UI-language (at least on Windows XP) you had to install some extras.

2) Using java-software not written for Java 7 gives you wrong user-interface language now

3) Writing java-software, which has to be backwards-compatible (used in different java-environments) is not compatible anymore when run with java 7.

So "Write Once ..." is broken.


REGRESSION.  Last worked in version 6u29

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
compile test-class with java 6,
execute test-class with java 6 and 7


ACTUAL -
when run with java 6: de_AT
when run with java 7: en_US


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.util.Locale;
public class TestLocale {
  public static void main(final String[] args) {
    System.out.println("default-locale = " + Locale.getDefault());
  }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
explicit define user.country and user.language to be backwards-compatible
but this is not always possible

Comments
EVALUATION The behavior change is intentional as a result for fixing 4700857. With this change, Java apps that use Locale.getDefault() for getting localized strings in menus/buttons, etc. will now display those strings in the UI Language provided by Windows (in this case, US English).
16-11-2011