Unable to start .jar files

Hi, I’m attempting to start ClickRepair by running the Linux .jar file. I attempted to run this command

java -jar ClickRepair.jar

in which I get this error message:

Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it,

	at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:166)
	at java.desktop/java.awt.Window.<init>(Window.java:553)
	at java.desktop/java.awt.Frame.<init>(Frame.java:428)
	at java.desktop/java.awt.Frame.<init>(Frame.java:393)
	at repairbase.Controller.<init>(Unknown Source)
	at clickrepair.CRController.<init>(Unknown Source)
	at ClickRepair.<init>(Unknown Source)
	at ClickRepair.main(Unknown Source)

I have tried running as superuser and have run export DISPLAY=parsley, parsley being the name of my machine. I would appreciate it if you could help.

What version of java do you have installed? Make sure you didn’t install the headless version.

I have a lot of java-related packages installed but I have jre-openjdk-headless installed, I installed jre-openjdk alongside it since the headless version is a dependency. I reran the command and received a different error this time. I am also running version 19.0.1u10-3 of jre-openjdk.

Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'parsley' as the value of the DISPLAY variable.
	at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
	at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:105)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
	at java.desktop/sun.awt.X11GraphicsEnvironment.initStatic(X11GraphicsEnvironment.java:64)
	at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:59)
	at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:37)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:93)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:84)
	at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:106)
	at java.desktop/java.awt.Window.initGC(Window.java:492)
	at java.desktop/java.awt.Window.init(Window.java:512)
	at java.desktop/java.awt.Window.<init>(Window.java:554)
	at java.desktop/java.awt.Frame.<init>(Frame.java:428)
	at java.desktop/java.awt.Frame.<init>(Frame.java:393)
	at repairbase.Controller.<init>(Unknown Source)
	at clickrepair.CRController.<init>(Unknown Source)
	at ClickRepair.<init>(Unknown Source)
	at ClickRepair.main(Unknown Source)

Did you mess up your DISPLAY variable trying to fix the problem?

Have you tried rebooting?

You could try

DISPLAY=:0 java -jar ClickRepair.jar