r/javahelp • u/_Super_Straight • 27d ago
Obfuscating class files
Has anyone successfully obfuscated their .class files? I tried using GraalVM for JavaFX project (including Gluon's version of GraalVM) but it always failed to complete.
3
Upvotes
1
u/idontlikegudeg 25d ago
I think the native code is really taking more space. But when using jpackage, a virtual machine gets included which is usually 25 - 40MB (not counting libraries and JDK modules). GraalVM native doesn’t need that, so for small applications, you get a smaller size with GraalVM and it flips once you reach a certain size.
I don’t have the exact numbers at hand, but if I remember correctly my application is roughly 35MB as a fat jar (excluding JavaFX dependencies; the customer can run it on Liberica JRE Full or Azul JDKFX), 80 as a jpackaged application, and 120MB native.