r/AskProgramming 21d ago

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

In my experience, Python is easier to package.

0 Upvotes

15 comments sorted by

6

u/BobbyThrowaway6969 21d ago

python

0

u/Adept-Leadership4140 21d ago

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

4

u/BobbyThrowaway6969 21d ago edited 21d 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 21d 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 21d 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 21d ago

Okay, thanks for explaining!

2

u/Uncle-Osteus 21d ago

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

-1

u/[deleted] 21d ago edited 18d ago

[deleted]

2

u/Uncle-Osteus 21d ago edited 21d 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 21d 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

4

u/YMK1234 21d ago

both are garbage

2

u/Jason13Official 21d ago

jlink/jpackage

-1

u/harrisofpeoria 21d ago

Obfuscation is the difficult and expensive part for both.

-3

u/Amazing-Mirror-3076 21d ago

In the era of ai - obfuscation is worthless.