What is Fat JAR?

Asked

Viewed 758 times

6

In my daily studies on Java on the Internet, I found some references and comments from programmers using this name "Fat JAR", in the context of configuration and deployment of Java applications.

As for me it did not become very clear what would be this "Fat JAR", I turn to colleagues to help me in the definition of the term "Fat JAR", what differs from a traditional JAR, and what would be the advantage of use.

2 answers

8


The fat jar, contains in addition to your code, all the dependencies that it needs to run, ie it takes your code plus the dependencies of your project and all this is bundled to a single file jar, this solution is widely used on servers where there is no internet.

I ended up meeting some other guys, like:

Skinny - Contains only created code and nothing else.

Thin - Contains all of the above plus direct application dependencies, database drivers, libraries and the like

Hollow - The inverse of Thin, contains only the code needed to run the application but does not contain the application itself.

Fat/Uber - Contains the code created plus the dependencies needed to run the program by itself

Tipos de pacotes jar

Source: https://dzone.com/articles/the-skinny-on-fat-thin-hollow-and-uber

2

Normal is your classes to be compiled for files jar individual, with Fat Jar you have everything in one file. That’s it. There is an advantage because files do not get loose and cannot be deleted improperly, it becomes easier to do the deploy and keep everything in order. So it’s just a way to package the code, but it’s the same bytecodes that always had before, it is not an executable.

  • so it’s just a different name to name the jar we normally generate at the end of the development of our applications for deploying on a server or providing to the client? Apparently I always did, I just didn’t know by that name.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.