AdoptOpenJDK / IcedTea-Web

The new home for IcedTea-Web
Other
229 stars 87 forks source link

Wrong Locale used #475

Closed ledahulevogyre closed 4 years ago

ledahulevogyre commented 5 years ago

I wrote this :

package me.leunen;

import java.util.GregorianCalendar;
import java.util.Locale;

public class Test {
  public static void main(String... args) {
    System.out.println(java.text.DateFormat.getDateInstance(java.text.DateFormat.LONG, new Locale("nl")).format(new GregorianCalendar(2019, 9, 15).getTime()));
  }
}

When executed from the command line, the output is "15 oktober 2019" and this is correct. But through IcedTea Web (here is a live test : https://leunen.me/test.jnlp ), I get the date in English instead of Dutch. (here is javaws_last_log.txt content).

Starting Netx, command: ["C:/Program Files (x86)/ojdkbuild/java-1.8.0-openjdk-1.8.0.222-2/webstart/../jre/bin/java.exe" -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:+UseSerialGC -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -splash:"C:/Program Files (x86)/ojdkbuild/java-1.8.0-openjdk-1.8.0.222-2/webstart/javaws_splash.png" -Xbootclasspath/a:"C:/Program Files (x86)/ojdkbuild/java-1.8.0-openjdk-1.8.0.222-2/webstart/javaws.jar" -classpath "C:/Program Files (x86)/ojdkbuild/java-1.8.0-openjdk-1.8.0.222-2/webstart/../jre/lib/rt.jar" -Ditw.userdata="C:/Users/cdewilde/AppData/Local/ojdkbuild/java-1.8.0-openjdk-1.8.0.222-2.b10.ojdkbuild.windows.x86/webstart/" -Dicedtea-web.bin.name=javaws.exe -Dicedtea-web.bin.location="C:/Program Files (x86)/ojdkbuild/java-1.8.0-openjdk-1.8.0.222-2/webstart/javaws.exe" net.sourceforge.jnlp.runtime.Boot -Xnofork -helpurl="https://github.com/ojdkbuild/ojdkbuild/wiki/WebStart" "C:\Users\cdewilde\AppData\Local\Temp\test.jnlp"]
Codebase matches codebase manifest attribute, but application is unsigned. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details.
Starting application [me.leunen.Test] ...
October 15, 2019

It seems to be system dependent. Not all computers that I tested on are affected. If you can't reproduce the issue, you can find more info about the system in my original report to ojdkbuild .

hendrikebbers commented 5 years ago

We just tried it on a linux system and received "15 oktober 2019" in the ITW log. So it may really only happen on specific systems. @ledahulevogyre you mentioned that you had the effect only on some systems. Can you say if it's os dependent?

ledahulevogyre commented 5 years ago

It doesn't seem OS dependent, because I get different outputs on machines that all runs Win10. Though it seems to depend on something in the system, anyway.

sclassen commented 5 years ago

Can you try to launch the jar from the JNLP with the java version of ITW manually:

"C:/Program Files (x86)/ojdkbuild/java-1.8.0-openjdk-1.8.0.222-2/webstart/../jre/bin/java.exe" -cp <path to jar from JNLP> me.leunen.Test
ledahulevogyre commented 5 years ago

@sclassen the output is correct when I run your command.

15 oktober 2019

ledahulevogyre commented 4 years ago

This is solved for me. It has been solved in build 8u242 of ojdkbuild. It was apparently already fixed in ITW.

Details in comments under https://github.com/ojdkbuild/ojdkbuild/issues/105