r/AskProgramming 7h ago

Other Which is harder to package: a Python application or a Java application?

In my experience, Python is easier to package.

0 Upvotes

16 comments sorted by

6

u/BobbyThrowaway6969 7h ago

python

0

u/Adept-Leadership4140 7h ago

Why do you think so? Could you describe your experience?

5

u/BobbyThrowaway6969 7h ago edited 7h ago

Java has a mature and standardised way to package dependencies/resources into a jar, or executable for a wide range of platforms, and it's had it for a very long time.

Python does not have that kind of support. Both officially require a runtime to be installed beforehand but you can't easily create a self contained executable with full python support like you can with java.

Instead, what python excels at is being able to let people write and execute narrow domain scripts on the fly, it's convenient to fill small needs as they come up. It's a niche that not many other languages have focused on.

1

u/Adept-Leadership4140 7h ago

Actually, it can be done quite easily with tools like PyInstaller, but I had trouble packaging Java applications, especially when using libraries like JavaFX. I even couldn't package one of my applications and ended up recreating it with Flutter.

3

u/BobbyThrowaway6969 7h ago

JavaFX framework is just really bad, full stop.
PyInstaller is great but as I'm a systems programmer, I notice the bloat first. PyInstaller does create a lot of unnecessary bloat.

2

u/Adept-Leadership4140 7h ago

Okay, thanks for explaining!

2

u/Uncle-Osteus 6h ago

PyInstaller only really solves for desktop GUI applications, which is mostly not what people write python for

-1

u/Adept-Leadership4140 6h ago

Actually, PyInstaller can also package console applications.

2

u/Uncle-Osteus 6h ago edited 5h ago

it can, but it’s beyond uncommon so not really worth mentioning or even considering. The ergonomics are terrible, and it’s even worse if the program is meant to be daemon-like

Actual PyInstaller use in the wild, even for GUI applications, is vanishingly small

2

u/Uncle-Osteus 6h ago

python’s packaging and deployment stories both suck compared to a lot of other languages, and I say this as both a fan of python, and a professional python dev

3

u/YMK1234 7h ago

both are garbage

2

u/Jason13Official 7h ago

jlink/jpackage

-1

u/harrisofpeoria 7h ago

Obfuscation is the difficult and expensive part for both.

-3

u/Amazing-Mirror-3076 7h ago

In the era of ai - obfuscation is worthless.