classinternalSource
public class X11Helper

Constructors

public X11Helper()

Methods

public static void configureGraphicsEnvironment(ProcessBuilder processBuilder, LaunchContext context)
Normalizes the child JVM graphics environment so Linux launches can fall back to X11 when a local Xwayland display is available.
Parameters
processBuilderProcessBuilderThe process builder for the child JVM,

which will be modified in-place to set DISPLAY and potentially XDG_SESSION_TYPE

contextLaunchContext
public static void configureGraphicsEnvironment(
    ProcessBuilder processBuilder,
    Path x11SocketDirectory,
    LaunchContext context
)
Normalizes the child JVM graphics environment using the supplied X11 socket directory.
Parameters
processBuilderProcessBuilder
x11SocketDirectoryPath
contextLaunchContext
public static Integer parseDisplayNumber(String socketName)
Parameters
socketNameString
Returns
Integer
public static String resolveDisplay(Path x11SocketDirectory)
Attempts to infer an active X11 display from socket names such as X0, X1, and so on.
Parameters
x11SocketDirectoryPathThe directory containing X11 socket files, typically /tmp/.X11-unix
Returns
StringA display string such as :0, :1, etc., or null if no valid display could be inferred
public static List<String> substituteVariables(List<String> arguments, Map<String, String> variables)
Replaces ${key} placeholders in the supplied arguments.
Parameters
argumentsList<String>
variablesMap<String, String>
Returns
List<String>