Score:2

Errors when running a swing application on Ubuntu 22.04.2

mh flag

I'm trying to run a very simple "hello world" Java application with swing on my computer where I have installed Ubuntu 22.04.2.

I have installed Java SDK 17 and have JAVA_HOME set on my ~/.bashrc:

export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")

I'm getting this error:

Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.

I have tried to set the DISPLAY value with:

unset DISPLAY
export DISPLAY=:0

Please advise. Thanks.

cocomac avatar
cn flag
Does it work [when you use X instead of Wayland](https://askubuntu.com/questions/1410256/how-do-i-use-x-instead-of-wayland-on-22-04)?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.