Issue
Any idea why with the java 11 SE https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html When I use the httpClient2 I cannot find the package after make the requires in module?
the module
module java {
requires java.net.http;
}
the error
Error:(2, 22) java: module not found: java.net.http
I also see a warning
Warning:java: module name in --add-exports option not found: java.net.http
This is the list of modules
java.base@11
java.compiler@11
java.datatransfer@11
java.desktop@11
java.instrument@11
java.logging@11
java.management@11
java.management.rmi@11
java.naming@11
java.net.http@11
java.prefs@11
java.rmi@11
java.scripting@11
java.se@11
java.security.jgss@11
java.security.sasl@11
java.smartcardio@11
java.sql@11
java.sql.rowset@11
java.transaction.xa@11
java.xml@11
java.xml.crypto@11
jdk.accessibility@11
jdk.aot@11
jdk.attach@11
jdk.charsets@11
jdk.compiler@11
jdk.crypto.cryptoki@11
jdk.crypto.ec@11
jdk.dynalink@11
jdk.editpad@11
jdk.hotspot.agent@11
jdk.httpserver@11
jdk.internal.ed@11
jdk.internal.jvmstat@11
jdk.internal.le@11
jdk.internal.opt@11
jdk.internal.vm.ci@11
jdk.internal.vm.compiler@11
jdk.internal.vm.compiler.management@11
jdk.jartool@11
jdk.javadoc@11
jdk.jcmd@11
jdk.jconsole@11
jdk.jdeps@11
jdk.jdi@11
jdk.jdwp.agent@11
jdk.jfr@11
jdk.jlink@11
jdk.jshell@11
jdk.jsobject@11
jdk.jstatd@11
jdk.localedata@11
jdk.management@11
jdk.management.agent@11
jdk.management.jfr@11
jdk.naming.dns@11
jdk.naming.rmi@11
jdk.net@11
jdk.pack@11
jdk.rmic@11
jdk.scripting.nashorn@11
jdk.scripting.nashorn.shell@11
jdk.sctp@11
jdk.security.auth@11
jdk.security.jgss@11
jdk.unsupported@11
jdk.unsupported.desktop@11
jdk.xml.dom@11
jdk.zipfs@11
And seems like is there, I'm really confuse. Maybe is a Intellij issue?
SOLUTION: IT Was an Intelllij issue. With the latest version properly configure works nice!
Solution
With java --list-modules
in your console, you can see all modules. Check if java.net.http is present (in java11 it should)
Answered By - ValerioMC