javalinuxjarlinux-mint

Problem when running a .jar on Linux Mint 21.1


Iḿ trying to run a jar file using java -jar file.jar and I get this message `[error] main:

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

I don´t know how to fix it, I tried export DISPLAY=:0 but it doesn´t work.

EDIT: I found out that I had also installed another java JDK version (11) and I tried to run it with that version, and it worked, but now I have another problem. The .jar that Iḿ trying to run (jedit.jar from Jason) says me that a file is 59.0 and JDK 11 only supports maximum 55.0 files. How can I install the JDK 17??

EDIT: I installed JDK 17 and it worked. And I have to say that clearly there`s a problem with java JDK 19, that was the version that I have installed apart from 11.


Solution

  • There was a problem with Java JDK 19 version, I installed the 17 one and problem solved, I don´t know exactly why.