import io.webfolder.cdp.RemoteLauncher;
import io.webfolder.cdp.RemoteLauncherBuilder;
import io.webfolder.cdp.session.SessionFactory;

import java.nio.charset.StandardCharsets;

import static java.util.Arrays.asList;

public class RemoteLaunching {

    public static void main(String[] args) throws IOException {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);

        try (BufferedReader br = new BufferedReader(new InputStreamReader(
                new FileInputStream(new File("path/to/your/private/key")),
                StandardCharsets.UTF_8))) {
            String s;
            while ((s = br.readLine()) != null) {

        RemoteLauncher l = new RemoteLauncherBuilder().withHost("")

        SessionFactory sf = l.launch(asList("--headless", "--disable-gpu"));

Download code sample

Integration with Maven

To use the official release of cdp4j, please use the following snippet in your pom.xml file.
Add the following to your POM's <dependencies> tag: