简体   繁体   English

在哪里可以找到 java.net.http package Jar 文件?

[英]Where I can Find java.net.http package Jar file?

I have searched too much but still didn't find nothing.我搜索了太多,但仍然一无所获。 I want a jar file which contains these classes.我想要一个包含这些类的 jar 文件。

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

My compiler doesn't support these imports.我的编译器不支持这些导入。 So, I want a jar.所以,我想要一个 jar。 Please help me请帮我

You can find it at this link for the OpenJDK version (here for the JDK 11 version):您可以在此链接中找到 OpenJDK 版本(此处为 JDK 11 版本):

https://jdk.java.net/java-se-ri/11 https://jdk.java.net/java-se-ri/11

Steps:脚步:

  • download the full JDK for the version and platform that you need (os, linux or win).下载您需要的版本和平台的完整 JDK(操作系统、linux 或 win)。
  • unzip it, navigate to the jmods folder解压缩,导航到jmods文件夹
  • find the java.net.http.jmod file.找到java.net.http.jmod文件。 Use it "as is" or rename it to java.net.http.jar “按原样”使用它或将其重命名为java.net.http.jar

jdk8 does not contains these classes,you can use URConnection connection = URL.openConnection() jdk8不包含这些类,可以使用URConnection connection = URL.openConnection()

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

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