How do I check whether the installed JRE is JRE-headless or the FULL-JRE?
As headless-JRE's are lightweight and they do not contain dependencies for GUI components, they are preferred for server applications and embedded systems.
How do I check whether the installed JRE is JRE-headless or the FULL-JRE?
As headless-JRE's are lightweight and they do not contain dependencies for GUI components, they are preferred for server applications and embedded systems.
As this question doesn't seem to ask for a code-snippet and I was looking for a way to simply be able to tell if a Java-installation supports GUI or not and (at least my) Google doesn't have an answer for that, my current wisdom is to check what's installed.
I'm not sure, but I think on Windows there's a command javaw
if Java supports GUI. On Linux one has to check what's installed:
[root@host ~]# yum list "*jdk*"
Last metadata expiration check: 4:50:52 ago on Wed 15 Mar 2023 05:08:08 CET.
Installed Packages
copy-jdk-configs.noarch 4.0-2.el8
java-1.8.0-openjdk.x86_64 1:1.8.0.362.b09-2.el8_7
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.362.b09-2.el8_7
Available Packages
...
[root@host ~]#
So the Java on this machine would provide a GUI as java-1.8.0-openjdk.x86_64
is installed. If it would only show java-1.8.0-openjdk-headless.x86_64
there won't be a GUI-mode.
However, I don't see how I could tell it by showing the version as the output is the same for GUI and headless:
[user@host bin]$ java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
[user@host bin]$