简体   繁体   中英

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.

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. Please help me

You can find it at this link for the OpenJDK version (here for the JDK 11 version):

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).
  • unzip it, navigate to the jmods folder
  • find the java.net.http.jmod file. Use it "as is" or rename it to java.net.http.jar

jdk8 does not contains these classes,you can use URConnection connection = URL.openConnection()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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