Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between openjdk-6-jre, openjdk-6-jre-headless, openjdk-6-jre-lib

Tags:

java

openjdk

I am having trouble understanding some of the basics of Java JRE.

I need to run Java code in an embedded system and for this I need a minimal Java Runtime Environment installed in a Linux kernel, that is to say, the minimum package necessary for executing Java binaries. I think it is not possible to do this only with a JVM (the JRE package is necessary, am I wrong here?)

The thing is, when looking at the Debian repositories I don't quite understand the differences between the packages openjdk-6-jre, openjdk-6-jre-headless and openjdk-6-jre-lib. Will Java programs run only with the former? or, are the three of them needed?

This is an issue as there is a big difference in size (MB) between them.

like image 215
Jorge Avatar asked Jun 18 '14 08:06

Jorge


People also ask

What is the difference between openjdk and openjdk headless?

Headless is the same version than the latter without the support of keyboard, mouse and display systems. Hence it has less dependencies for runtime (no all Xorg display packages chain …) and it makes it more suitable for server applications.

What means Jdk headless?

Headless software (e.g. "headless Java" or "headless Linux",) is software capable of working on a device without a graphical user interface. Such software receives inputs and provides output through other interfaces like network or serial port and is common on servers and embedded devices.

What is the difference between openjdk headless openjdk openjdk devel packages?

The openjdk-7-jre-headless package is used when you don't need to draw anything in the graphical user interface. For example a background service or a terminal application. It's commonly used on servers. The openjdk-7-jre package includes the openjdk-7-jre-headless package since it contains most of the Java features.

What is headless version of Java?

Headless mode is a system configuration in which the display device, keyboard, or mouse is lacking.


2 Answers

You are correct in that you will need a JRE package to run any Java application.

Since you say you're running on an embedded platform I assume that the Java application you want to run has no GUI. In that case, you will be fine with openjdk-6-jre-headless. This is explained on the openjdk-6-jre-headless package page here "Minimal Java runtime - needed for executing non GUI Java programs".

As you can see from the debian package details page, openjdk-6-jre-headless depends on openjdk-6-jre-lib (among other packages), so that will get installed either way.

If however the Java application you want to run has a GUI, you will need openjdk-6-jre instead of openjdk-6-jre-headless

like image 65
Woodham Avatar answered Oct 13 '22 06:10

Woodham


The main reason for having two distinct packages available are the dependencies of the packages. openjdk-6-jre will also depend on:

libasound2, libgif4, libjpeg62, libpng12-0, libpulse0 , libx11-6, libxext6, libxi6, libxrender1, libxtst6 and zlib1g 

And contrary to the previous comment openjdk-6-jre depends on openjdk-6-jre-headless, making the latter really just a subset.

like image 37
Daniel Avatar answered Oct 13 '22 06:10

Daniel