英文:
Problem when running a .jar on Linux Mint 21.1
问题
我尝试运行一个.jar文件,使用java -jar file.jar
,但我得到这个错误信息:
异常在线程"main"
java.awt.HeadlessException: 未设置X11 DISPLAY变量,
或未找到Headful库支持,
但该程序执行了需要它的操作。
我不知道如何修复它,我尝试了export DISPLAY=:0
,但它不起作用。
编辑:
我发现我还安装了另一个Java JDK版本(11),我尝试使用该版本运行它,它可以工作,但现在我有另一个问题。我尝试运行的.jar文件(来自Jason的jedit.jar)告诉我一个文件是59.0,而JDK 11只支持最大55.0文件。如何安装JDK 17?
编辑:
我安装了JDK 17,它可以工作。
而且我必须说,显然Java JDK 19存在问题,那是我除了11之外安装的版本。
英文:
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.
答案1
得分: 0
有问题的是Java JDK 19版本,我安装了17版本,问题得以解决,我不太清楚原因。
英文:
There was a problem with Java JDK 19 version, I installed the 17 one and problem solved, I don´t know exactly why.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论