我topcat-full.jar
从topcat
TOPCAT 网站,按照说明(chmod +x topcat
)并尝试启动 topcat。但是
./topcat
引发错误
Exception in thread "main" java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
at java.awt.Window.<init>(Window.java:536)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.JFrame.<init>(JFrame.java:189)
at uk.ac.starlink.topcat.AuxWindow.<init>(AuxWindow.java:95)
at uk.ac.starlink.topcat.ControlWindow.<init>(ControlWindow.java:244)
at uk.ac.starlink.topcat.ControlWindow.getInstance(ControlWindow.java:759)
at uk.ac.starlink.topcat.Driver.getControlWindow(Driver.java:556)
at uk.ac.starlink.topcat.Driver.runMain(Driver.java:448)
at uk.ac.starlink.topcat.Driver.main(Driver.java:185)
正在做
java -jar topcat-full.jar
也引发了
Exception in thread "main" java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
at java.awt.Window.<init>(Window.java:536)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.JFrame.<init>(JFrame.java:189)
at uk.ac.starlink.topcat.AuxWindow.<init>(AuxWindow.java:95)
at uk.ac.starlink.topcat.ControlWindow.<init>(ControlWindow.java:244)
at uk.ac.starlink.topcat.ControlWindow.getInstance(ControlWindow.java:759)
at uk.ac.starlink.topcat.Driver.getControlWindow(Driver.java:556)
at uk.ac.starlink.topcat.Driver.runMain(Driver.java:448)
at uk.ac.starlink.topcat.Driver.main(Driver.java:185)
我正在使用 Fedora 30,并java -version
说
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
我怎样才能让 TOPCAT 运行?
我尝试安装 openjdk
yum install java-openjdk
但运行时我仍然收到相同的错误消息./topcat
答案1
答案2
从@Hastur 的评论来看,我确实
sudo alternatives --config java
java-latest-openjdk.x86_64
然后我从列表中选择并./topcat
再次尝试,它成功了,但我不知道为什么。