Java 11 is coming soon, compiling & running a command to get it done!

Source: Internet
Author: User
Tags shebang

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 330This 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 330the 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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.