Sway: Android Studio Not working

Created on 15 Aug 2019  路  5Comments  路  Source: swaywm/sway

Android Studio Shows a grey thingy only not working even after exporting the _JAVA_AWT_WM_NONREPARENTING=1
2019-08-15-150449_grim

Most helpful comment

Setting _JAVA_AWT_WM_NONREPARENTING=1 fixes AS for me. I don't think you've successfully set it in sway's environment.

All 5 comments

Setting _JAVA_AWT_WM_NONREPARENTING=1 fixes AS for me. I don't think you've successfully set it in sway's environment.

Not so much a solution, but a workaround (similar to setting _JAVA_AWT_WM_NONREPARENTING) is to install a tool called wmname and run wmname LG3D. See also the Arch Wiki. It seems to be an issue with other Java-based GUIs as well, including Jetbrains products and Matlab, to name a few. However, after using this command, I still encountered some glitches in their GUIs, though they are mostly usable.

Going to close this since while annoying, there's not much that can be done on sway's end -- the issue is on Java's end, and whatever fixes happen there (i.e. real Wayland support) will trickle down into Jetbrains IDEs.

There's a note regarding the _JAVA_AWT_WM_NONREPARENTING workaround in https://github.com/swaywm/sway/wiki/Running-programs-natively-under-Wayland

Using Java 14 for Android Studio, but keeping Java 8 for development, solved the issue for me:

# For Android Studio
export _JAVA_AWT_WM_NONREPARENTING=1
export STUDIO_JDK=/usr/lib/jvm/java-14-openjdk

# For Gradle
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk

I'm on Arch Linux. Adjust the paths so that they point to a valid location on your system.

Was this page helpful?
0 / 5 - 0 ratings