So i want to try the http client
package com.company;
import jdk.incubator.http.HttpClient;
public class Main {
public static void main(String[] args) {
I ran into the same problems
java.lang.NoClassDefFoundError: jdk/incubator/http/HttpClient
with java-9-ea+173
and IntelliJ. I followed Eugenes and Nicolais advice to add jdk.incubator.httpclient
explicitly to the module path via --add-modules jdk.incubator.httpclient
in Run/Debug Configurations (on macOS: Menu Bar -> Run -> Edit Configurations -> Configuration Tab -> VM Options -> --add-modules jdk.incubator.httpclient
After that everything worked fine. Of course you have to add the dependency into the module-info.java
like this as said before:
module network {
requires jdk.incubator.httpclient;
}
UPDATE:
With the latest IntelliJ IDEA 2017.2 EAP 172.2953.9 , I don't need to put the --add-modules
to the VM Options. It just works out of the box.