-werners-
Esteemed Contributor III

for a jar you need to build it (using SBT for example). Notebooks are not able to do that.

I create jars in IntelliJ with SBT.

What you can do is not using a jar at all but use package cells.

However I do not think those are used a lot because a while ago I asked a question on the forum who uses package cells and nobody confirmed they did.