I have a maven aggregate project that contains api, application, domain, infrastructure and common-util modules.
The aggregate project JDK version is 17, but the common-util module alone uses JDK8 instead of 17 (for more compatibility).
All source code in common-util modules does not use Java 9 and subsequent releases' syntax, but this module uses the JDK HTTP Client provided since Java 11. The HTTP interface class has two implementation classes, Java11Impl and ApacheImpl, and the latter should be used for versions lower than Java11.
Now the problem is that I can't compile the module with JDK8, the compiler tells me package java.net.http does not exist.
Can I get the compilation done by javac options like -bootclasspath? How should I do this?