Can't find java.net.http package in build
I'm making a plugin for a server for the game Minecraft, and I'm trying to send a post request using Java with code I found on stack overflow, however, when i try to import the base java java.net.http.HttpClient and java.net.http.HttpResponse packages, and run the build, it errors with the message "package java.net.http does not exist" once for each of the imports, even though I'm sure it should be able to see them as it can see other base java packages such as "java.io.InputStream" which are stored in the same place I thought, so any help to fix this would be appreciated. Also, when writing the import command, IntelliJ is suggesting the .HttpClient ending to the statement, so it shows it can see and recognise it, but then does use it in the build
Please sign in to leave a comment.
In File | Project Structure (
CTRL+ALT+SHIFT+S), ensure java 11 is selected as project SDKIf possible, please share a sample project via GitHub, or https://uploads.jetbrains.com