XWayland server provides limited capabilities for X11 desktop applications (see X11 Application Support  and JDK-8269245). In order to get full support of the desktop features, we need to implement a pure Wayland client toolkit for java. Wayland architecture in many ways differs from X11, so we cannot reuse XAWT even for basic capabilities. The new toolkit should be implemented from scratch. Here are some major chunks of work:

 

The prototype implementation of the pure Wayland toolkit (JDK-8281970) based on OpneJDK 25 source base can be found in the Wakefield repository (jdk25-wayland branch). It has two rendering pipelines:

Most of the graphics primitives are supported in hardware-accelerated rendering, so it's possible to run Swing applications on top of it. 

 java -Dawt.toolkit.name=WLToolkit -Dsun.java2d.vulkan=True -jar SwingSet2.jar



Here is an updated build instruction for building jdk25-wayland branch (on ubunu 24.04). You need to have at least JDK24 for bootstrapping:

$ sudo wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | tee /etc/apt/trusted.gpg.d/lunarg.asc

$ sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list https://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list

$ sudo apt update

$ sudo apt-get -y install file zip unzip autoconf make build-essential libx11-dev libxext-dev libxrender-dev \

libxtst-dev libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev libwayland-dev \

 libxkbcommon-x11-0 vulkan-sdk vulkan-utility-libraries-dev

$ sh configure --with-vulkan

$ make images


Here are some performance resuls with RenderPerfTest:

java -Dawt.toolkit.name=WLToolkit -Dsun.java2d.vulkan=True -jar ./dist/RenderPerfTest.jar 
Vulkan rendering enabled: YES
  Presentation enabled: YES
  Accelerated surface data enabled: YES
  Devices:
    *0: AMD Radeon RX 6800 XT (RADV NAVI21)
     1: llvmpipe (LLVM 19.1.1, 256 bits)
#  Using GraphicsConfiguration(s): [0-0][WLVKGraphicsConfig[B8G8R8A8_UNORM, AMD Radeon RX 6800 XT (RADV NAVI21) (DISCRETE_GPU), LEN LEN T27p-10]]

Test NameMedian(FPS) ± Stddev(FPS) Unit
ArgbSurfaceBlitImage54.750 ± 4.797
ClipFlatBox800.360 ± 8.649
ClipFlatOval251.432 ± 23.458
FlatBox812.009 ± 5.980
FlatBoxAA812.466 ± 6.239
FlatOval106.856 ± 0.422
FlatOvalAA49.510 ± 0.134
FlatQuad109.489 ± 7.471
FlatQuadAA22.130 ± 0.227
Image49.331 ± 4.920
ImageAA51.265 ± 3.969
LargeTextGray806.916 ± 9.320
LinGrad3RotatedOval0.189 ± 0.002
LinGrad3RotatedOvalAA49.570 ± 0.136
LinGradRotatedOval218.528 ± 6.911
LinGradRotatedOvalAA51.607 ± 0.170
TextGray219.214 ± 2.097
VolImage824.738 ± 2.505
WiredBubbles107.861 ± 1.979