Home > News content

Oracle's Java Modular System Battle

via:博客园     time:2017/6/26 14:01:02     readed:1689

English Original:Oracle Defends the Java Module System

One of the most timely speeches of the Emerging Technology (ETE) Conference in 2017 is to be presented by Karen Kinnear, head of Oracle JVM,The future of Java: modular and others& Rdquo ;. There was a lot of time before her presentation, the most notable of which was the May 8 vote for JSR 376.

Kinnear introduces Java 9 goals, including improved developer efficiency and improved Java cloud API. In the rightJava 9 related to JEPAfter some review, she began to focus onJava platform modular system(JPMS) topic. JPMS is alsoJigsaw projectorJSR 376The

Kinnear asked the attendees three questions about the modularity.

  • Module missing problem.
  • The module system detects the missing module when building the block diagram.
  • Conflict problem.
  • Conflict problems with packages when building block diagrams are also detected.
  • Change the internal API is safe?
  • The module system ensures that the internal API can not be accessed from outside the module.

Kinnear said the module can be integrated into an existing application, and she also demonstrates how the package interacts with the module, explaining the difference between the module path and the classpath. She also introduced to the developer how to migrate to Java 9, especially how to keep backward compatibility during the migration process.

Oracle Java platform group chief architectMark ReinholdIn March of 2016white paperDescribes the JPMS goal.

  • Reliable configuration
  • Use a declarative program component dependency mechanism instead of a fragile and error-prone classpath mechanism.
  • Strong package
  • The component can declare which of its public types can be accessed by other components which can not be accessed.

Community response

Red Hat's JBoss architecture vice chairmanScott StarkExpressed some of his presence on JPMSdoubt, Red Hat believes that these issues are the main factors that affect JPMS's inability to reach JSR's goal. Stark said:

Jigsaw is a brand new modular system that can be used very well on Java, but not on the JVM-based real-world application in the production environment on a large scale attempt to apply JPMS. Many applications may not be able to use Jigsaw, or require significant refactoring.

IBM and Red Hat publicly said theyWill not vote for the current JPMS voteThe

Despite the lack of agreement, Reinhold is stillSubmitted a preview version of JSR 376And declare that this is the most useful for the vast Java ecosystem, so we can achieve a real goal. On the day of the poll, he also submitted a copy to the Executive Committee (EC)open letter, Calling them to vote for JSR 376. However, the final JSR 376 stillFailed to passvote.

After voting

Twitter JVM and GC engineersTony PrintezisexplainedTwitter vote against the reasonsThe

Our main question is that JPMS may subvert the developers, but failed to bring them direct benefits. We are worried that this will hinder the adoption of this technology on a large scale. We hope JPMS will be able to make a more comprehensive adjustment of the initial goal, so that the real solution to the pain of the developer. For example, non-public package names conflict with the current JSR & ldquo; do not interfere with each other and "strong package" and the goal is inconsistent. And if the module can be more completely separated, then you can hide the package within the module to support the same package multiple copies exist at the same time. This intuitive advantage simplifies the work of the developer's modular code, and therefore accelerates the adoption of JPMS.

With infoWorld onceInterviews, Reinhold tried to clarify the misunderstanding of JPMS. On the issue of opposition to the use of Maven in Java, Reinhold said that this is not true, and that can be used in Java 9. But he admits that Maven's plugins may not work properly, includingSurefire test pluginThe

Reinhold confirms that some of the developers' favorite libraries, frameworks, and tools may not be used in Java 9 because of some of the factors that have been made, but he may be able to solve these problems when they are officially released. He pointed out that the maintainers of these projects are already using Java 9 pre-release, so they will be ready for these projects to support Java 9. This is why some projects already have to use Java 9, such asSpring BootwithHibernate ValidatorThe

Many development teams believe that Java 9 can not be used until they block all the code, framework, and libraries. Reinhold said it was wrong.

Developers can continue to use classpaths in Java 9, but because Java 9 has a modular mechanism, developers no longer need classpaths.

London Java community co-founder and jClarity CEOMartijn VerburgversusInfoQ ExchangeHis views on JSR 376 vote. Speaking of the benefits of the JVM modularity, he said:

It provides more security for Java code; it hides a lot of internal APIs or should not be exposed to the developer's API; however, it needs to provide a secure alternative for those hidden features. Java runtime will become smaller because the runtime is split into smaller modules. Java 9 will be providedJlinkTool, used to deploy the application on a smaller run time, only install the necessary components. Server-side applications do not need to include the client's GUI (such as AWT). In this way, Java can start faster, you can run applications on smaller devices, the deployment of the cloud will be faster.

IBM Senior Technical ResearcherTim EllisonRecently expressed his rightGet a consensus on JSR 376the opinion of. He said:

We would like to see the revised specifications reintroduce to the JCP Executive Committee and hope that the Executive Committee will support the conclusions of the Expert Group. IBM is concerned about the compatibility of enterprise applications when migrating to Java 9. Upgrading to Java 9 has a significant impact on migration, and JPMS's default behavior will be of great help in this regard.

JSR 376 is about to enter the final stage. There may be some minor changes before the finalization, but the whole process shows that JCP is committed to providing more powerful language features for Java. Thanks to Oracle for leading the specification and the energy that the panel has invested in this milestone.

Reinhold recently proposed a new release for the Java 9 release date for Java 9proposalThe He said:

In order to meet all the possible results, I recommend keeping the JDK 9 initial candidate release date unchanged on June 22, but postponing the release date of the GA version for more time through the JCP process. I propose to postpone the release date of the GA version for 8 weeks, adjusted from July 27 to September 21.

The next poll date for JSR 376 is Monday, June 26, 2017.

Reference materials

Edit Postscript

Michael Redlich is an active participant in ETE who has been a participant and speaker for ETE since 2008 and a member of the ETE Steering Committee in 2013.

China IT News APP

Download China IT News APP

Please rate this news

The average score will be displayed after you score.

Post comment

Do not see clearly? Click for a new code.

User comments