dim
dim copied to clipboard
Solve legacy JDK 8 binding to JDK-internal classes
The statically included (and altered) dnsjava source that is located in pdns-output/jdnssec-dnsjava is based on dnsjava 2.1.7. Dnsjava 2.1.7 has hard dependencies on JDK 8 internal classes that were not meant to be used by application code and that were removed in later JDKs.
When building with JDK 11:
...
> Task :jdnssec-dnsjava:compileJava FAILED
...dim/pdns-output/jdnssec-dnsjava/src/main/java/org/xbill/DNS/spi/DNSJavaNameServiceDescriptor.java:16: error: cannot find symbol
public class DNSJavaNameServiceDescriptor implements NameServiceDescriptor {
^
symbol: class NameServiceDescriptor
...dim/pdns-output/jdnssec-dnsjava/src/main/java/org/xbill/DNS/spi/DNSJavaNameServiceDescriptor.java:18: error: cannot find symbol
private static NameService nameService;
^
symbol: class NameService
location: class DNSJavaNameServiceDescriptor
...dim/pdns-output/jdnssec-dnsjava/src/main/java/org/xbill/DNS/spi/DNSJavaNameServiceDescriptor.java:30: error: cannot find symbol
public NameService
^
symbol: class NameService
location: class DNSJavaNameServiceDescriptor
...dim/pdns-output/jdnssec-dnsjava/src/main/java/org/xbill/DNS/spi/DNSJavaNameServiceDescriptor.java:7: error: package sun.net.spi.nameservice does not exist
import sun.net.spi.nameservice.*;
^
...dim/pdns-output/jdnssec-dnsjava/src/main/java/org/xbill/DNS/utils/HMAC.java:87: warning: [dep-ann] deprecated item is not annotated with @Deprecated
HMAC(MessageDigest digest, byte [] key) {
^
...dim/pdns-output/jdnssec-dnsjava/src/main/java/org/xbill/DNS/utils/HMAC.java:101: warning: [dep-ann] deprecated item is not annotated with @Deprecated
HMAC(String digestName, byte [] key) {
^
...dim/pdns-output/jdnssec-dnsjava/src/main/java/org/xbill/DNS/spi/DNSJavaNameServiceDescriptor.java:21: error: cannot find symbol
ClassLoader loader = NameService.class.getClassLoader();
^
symbol: class NameService
location: class DNSJavaNameServiceDescriptor
...dim/pdns-output/jdnssec-dnsjava/src/main/java/org/xbill/DNS/spi/DNSJavaNameServiceDescriptor.java:22: error: cannot find symbol
nameService = (NameService) Proxy.newProxyInstance(loader,
^
symbol: class NameService
location: class DNSJavaNameServiceDescriptor
...dim/pdns-output/jdnssec-dnsjava/src/main/java/org/xbill/DNS/spi/DNSJavaNameServiceDescriptor.java:23: error: cannot find symbol
new Class[] { NameService.class },
^
symbol: class NameService
location: class DNSJavaNameServiceDescriptor
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors
2 warnings
Adopt OpenJDK has JDK 8 support until "At Least May 2026".