Tools.java currently defines the following list of variables to be preserved
private static final String[] DEFAULT_UNIX_ENV_VARS = {
"DISPLAY", "GNOME_DESKTOP_SESSION_ID", "HOME", "LANG",
"LC_ALL", "LC_CTYPE", "LPDEST", "PRINTER", "TZ", "XMODIFIERS"
};
But modern Linux systems need some others preserved
XDG_RUNTIME_DIR
and
DBUS_SESSION_BUS_ADDRESS
are two that are set in all login environments (ie ssh etc not just desktop)
and seem important to default correct functioning of some platform libraries
If your UID is 1000 then typical values on Ubuntu 22.04 look like
XDG_RUNTIME_DIR=/run/user/1000
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
There are other XDG* variables set in desktop sessions but I do not know how important they are. for example
XDG_SESSION_TYPE=x11 (I think wayland is the other likely value)
XDG_CURRENT_DESKTOP=ubuntu:GNOME
We can worry about those later if they are shown to be needed.
BTW Although we still need to run on older Linuxes on ubuntu 22.04 we have
GNOME_DESKTOP_SESSION_ID=this_is_deprecated
So some day (not yet) we could dispense with that
private static final String[] DEFAULT_UNIX_ENV_VARS = {
"DISPLAY", "GNOME_DESKTOP_SESSION_ID", "HOME", "LANG",
"LC_ALL", "LC_CTYPE", "LPDEST", "PRINTER", "TZ", "XMODIFIERS"
};
But modern Linux systems need some others preserved
XDG_RUNTIME_DIR
and
DBUS_SESSION_BUS_ADDRESS
are two that are set in all login environments (ie ssh etc not just desktop)
and seem important to default correct functioning of some platform libraries
If your UID is 1000 then typical values on Ubuntu 22.04 look like
XDG_RUNTIME_DIR=/run/user/1000
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
There are other XDG* variables set in desktop sessions but I do not know how important they are. for example
XDG_SESSION_TYPE=x11 (I think wayland is the other likely value)
XDG_CURRENT_DESKTOP=ubuntu:GNOME
We can worry about those later if they are shown to be needed.
BTW Although we still need to run on older Linuxes on ubuntu 22.04 we have
GNOME_DESKTOP_SESSION_ID=this_is_deprecated
So some day (not yet) we could dispense with that
- relates to
-
JDK-8313903 Test sanity/client/SwingSet/src/FileChooserDemoTest.java failed: timed out waiting for count of file
- Closed