Expand my Community achievements bar.

SOLVED

Queries on Jar files

Avatar

Former Community Member

Hi All,

What is the difference between OSGI Jar file and Normal Jar file?

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi,

Just to be clear, every JAR file has a MANIFEST.MF file in it. OSGi defines additional headers which go in the manifest, but the core file and format (and placement within the JAR file) is defined by the Java core specification.

Regards,

Justin

View solution in original post

2 Replies

Avatar

Level 10

OSGi jar which are known as bundle requires OSGi metadata in its manifest so that an OSGi framework can manage the visibility of classes between bundles. A JAR without this metadata would only contain invisible classes, could not see any classes from other bundles, nor could it get started in any way. The Import-Package manifest header tells what packages should be made visible to the bundle, and the Export-Package defines the packages in the bundle that should be made visible to others.

Normal jar wouldnt have this metadata or a manifest file

Avatar

Correct answer by
Employee

Hi,

Just to be clear, every JAR file has a MANIFEST.MF file in it. OSGi defines additional headers which go in the manifest, but the core file and format (and placement within the JAR file) is defined by the Java core specification.

Regards,

Justin