Java 11 is coming, scheduled to release in September, there are less than 3 months, please expect more new features to be added to the 11, this article is about
JEP 330
This new feature.
Simplify and simplify, a command to compile and run the source code
Look at the code below.
// 编译javac Javastack.java// 运行java Javastack
In our cognition, to run a Java source code must first compile, then run, two steps to execute the action. In the future version of Java 11, a java
command will be done directly, as shown below.
java Javastack.java
However, there is no egg in it. Most of our development work is in the IDE tools, all of the compile run process is done by the IDE, really use the command line to compile, run the scene really very little. Of course, if you are the god of Notepad, please accept this function.
On the other side, does that mean javac
exiting the historical stage? No. Because, instead of running directly, you need to compile the command for the source code.
Support Shebang #! Symbol Run Java Program
Shebang #! What the hell is this? This is also JEP 330
the relevant technology inside, which can support running Java programs in UNIX system scripts, as shown in the following code.
#!/path/to/java --source version
JEP 330 Summary
JEP 330
the Oracle feature is intended to be provided for compiling and running small Java applications, rather than using Java to become a universal language. The feature review was controversial, but a final consensus confirmation would be added to the new version of Java 11.
Reference: https://securityonline.info/jdk-11-will-introduce-shebang-symbol/
Recommended: Spring Boot & Cloud's Strongest technology tutorials
Scan attention to our public number, dry foods updated daily.
Java 11 is coming soon, compiling & running a command to get it done!