简体   繁体   English

Java11中找不到jdk.incubator.httpclient模块

[英]The jdk.incubator.httpclient module not found in Java11

Using the early access build for JDK/11 to compile an existing code based on Java-9 which was using a VM argument 使用JDK / 11早期访问构建来编译基于使用VM参数的Java-9现有代码

--add-modules jdk.incubator.httpclient

to resolve the HTTP/2 client incubator module now ends up with a compilation error 解决HTTP / 2客户端孵化器模块现在最终出现编译错误

Module not found: jdk.incubator.httpclient 找不到模块:jdk.incubator.httpclient

Java version details :- Java版本详细信息: -

 java 11-ea 2018-09-25 Java(TM) SE Runtime Environment 18.9 (build 11-ea+11) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11-ea+11, mixed mode) 

With the standardization of the HTTP Client API , the incubated APIs are now removed. 通过HTTP Client API标准化,现在可以删除孵化的API。

The module name and the package name of the standard API will be java.net.http which can now be used as - 标准API的模块名称和包名称将是java.net.http ,现在可以用作 -

module <yourModuleName> {
    requires java.net.http;
}

Also, adding to the tally, the applications, frameworks(like Maven, Gradle etc) or IDEs relying on the classpath would no more need to set the following command-line option to request the incubator module to be resolved: 此外,添加到计数器,应用程序,框架(如Maven,Gradle等)或依赖类路径的IDE 将不再需要设置以下命令行选项来请求解析孵化器模块:

--add-modules jdk.incubator.httpclient    OR      --add-modules java.net.http

Since being a standard module the java.net.http module shall be resolved by default . 由于作为标准模块 ,默认情况下解析 java.net.http模块。


Edit :- I've jotted down the migration steps required for a transition from incubation to the standard implementation of the HTTP/2 client @ Medium . 编辑 : - 我已经记下了从孵化过渡到HTTP / 2客户端@ Medium的标准实现所需的迁移步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM