MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.67k stars 1.34k forks source link

Building from source won't work with "complex" system locales #5157

Closed rzats closed 10 months ago

rzats commented 11 months ago

What you were trying to do

Build from source!

What actually happened

On one of my machines the system locale is a two-parter, en_UA (English language, Ukrainian region). Unfortunately, Java expects a two-letter locale (just the language). So this leads to a cascade of errors:

14:21:56.939 [main] WARN  o.t.e.c.f.c.LocaleConstraint - Locale en_UA should be one of [,nn,ar,bg,kea,nds,zu,am,fr,ti,bo, ... many other 2 letter codes ...]
14:21:56.942 [main] ERROR o.t.g.u.r.SimpleClassFactory - Failed to instantiate class: class org.terasology.engine.config.SystemConfig
...
Caused by: java.lang.IllegalArgumentException: The default value must be a valid value. Check the logs for more information.
14:21:57.024 [main] ERROR o.t.engine.core.TerasologyEngine - Failed to initialise Terasology
java.lang.NullPointerException: null

How to reproduce

Build from source on a similar machine. I'll have a fix for this soon though!

jdrueckert commented 10 months ago

@rzats interestingly, I cannot even find the en_UA locale for installing and enabling it 🤔 maybe the error is not generally related to locales of format xx_XX but to this specific locale?

soloturn commented 10 months ago

@rzats to my knowledge enUA would mean that ukraine has a different english variant, so with maybe different words, grammar, etc. that variant of english seems to be not standardized, as @jdrueckert remarks. the region you live in is set in different variables, here an example from romania, some english variant is set, and the other LC variables are set to region romania: https://www.baeldung.com/linux/locale-environment-variables

what does public static Locale.Category[] values() return for you?

see: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Locale.Category.html