In other words, if the conditions are met, you can simply compile and run the single-file program directly without having to call javac or package the jar file.
For example, you can run directly:
java HelloWorld.java
And no longer need:
javac -d <memory> HelloWorld.javajava -cp <memory> hello.World
In addition, JEP 330 also introduces Shebang and related technologies that are commonly used in Unix system scripts and will support the use of this mechanism to execute Java programs, such as:
#!/path/to/java --source version
In the description, Jonathan Gibbons stated that the goal of the JEP is not to accept shebang for changing the Java Language Specification (JLS) or javac, nor is it to evolve the Java language into a universal scripting language. But for a more pure compilation of small programs, reduce overhead.
On May 17-24, 2018, the draft of JEP 330 was launched on the mailing list. Due to differences in opinions, the discussion was fierce. Only one week of review time was allowed until May 31. On June 1st, Java Chief Architect Mark Reinhold stated that although not every committer was completely satisfied with the JEP, basically everyone has reached a consensus, JEP 330 will be officially added to JDK 11.
“At this point not every Committer is completely happy with this JEP, but it appears to me that Jon has satisfactorily addressed the issues raised thus far and updated the JEP accordingly. I’ve therefore targeted this JEP to JDK 11.”
– Mark