79835614

Date: 2025-12-02 08:06:06
Score: 5
Natty:
Report link

I've been stuck on this for 3 days. I'm building a launcher compiled to GraalVM native-image (machine code, no JVM). The launcher decrypts a 400MB JAR file in memory and needs to execute it without writing to disk for security reasons.

I've tried using the RemoteClassLoader approach from this answer, but ClassLoader.defineClass() it doesn't work in native-image since there's no JVM bytecode interpreter. I've also tried embedding JVM via JNI (too complex, 200MB+ overhead) and spawning java -jar with temp files (works but defeats the purpose, writes pure JAR to disk).

Is there ANY way to achieve pure in-memory JAR execution from native-image with zero disk writes? How do enterprise launchers (like game launchers, IDEs) handle this? Are there JVM internal APIs or alternative launching mechanisms I'm missing?

The constraint is: GraalVM native-image launcher -> decrypt JAR in memory-> launch without disk writes. I can bundle a JRE and spawn processes, but the application JAR must never touch the filesystem. I have a working method of writing to temp, it's just simple, but this is not what i want

Any suggestions would be greatly appreciated! I really need help from you all legends.

Reasons:
  • Blacklisted phrase (1): appreciated
  • Blacklisted phrase (1): Is there ANY
  • RegEx Blacklisted phrase (2): Any suggestions
  • RegEx Blacklisted phrase (1): i want
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Robert Hood