Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
370 views
in Technique[技术] by (71.8m points)

java - 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

--add-modules jdk.incubator.httpclient

to resolve the HTTP/2 client incubator module now ends up with a compilation error

Module not found: jdk.incubator.httpclient

Java version details :-

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)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

With the standardization of the HTTP Client API, the incubated APIs are now removed.

The module name and the package name of the standard API will be java.net.http which can now be used as -

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:

--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.


Edit:- I've jotted down the migration steps required for a transition from incubation to the standard implementation of the HTTP/2 client @ Medium.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...