Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How do you run a Java program without compilation?


It technically compiles it to memory before running it, but the point is that you don't have to invoke javac first. It's a relatively new feature.


Do you know for which Java version this first became available?


11: https://openjdk.org/jeps/330

Oh so actually, you can use a shebang, just without the .java extension and with the "--source" flag, it's specifically written out in that spec. I was doing my experiment wrong!


Awesome, thanks for sharing!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: