JEP 495: Simple Source Files and Instance Main Methods (Fourth Preview)
Mainly for education but also for writing simple scripts
🔹 What JEP 495 Introduces
Simple source file execution: Java can now run
.java
files without compiling them first, even if they're in a package or use preview features.Instance
main()
methods: You can now define themain()
method as an instance method, not just static.
RUN:
To see that instance method main will be run - it doesn't have to be static anymore.
RUN:
To see that you can run simple java programs
RUN:
PreviousJEP 494: Module Import Declarations (Second Preview)NextJEP 496: Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism
Last updated