Projects tigase _server tigase-utils Issues #19
tigase-utils doesn't compile with JDK12 (#19)
Closed
wojciech.kapcia@tigase.net opened 5 years ago
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project tigase-utils: Compilation failure: Compilation failure:
[ERROR] /Users/wojtek/dev/tigase/tigase-utils/src/main/java/tigase/cert/OldSelfSignedCertificateGenerator.java:[20,1] package sun.security.x509 does not exist

as per previous comment in the class:

// This may stop working very soon as JDK9 warns about usage of internal classes which may be removed in the future.
public class OldSelfSignedCertificateGenerator
		implements CertificateGenerator {
wojciech.kapcia@tigase.net commented 4 years ago

@kobit the "simplest" option would be to use BouncyCastle, but I'm far from convinced it would be best one (for one - it's 4MB dependency o a very small library that tigase-utils is). Any replacement API in JDK itself is not (yet) available:

From what I saw, the package and required classes are still there (see sun.security.x509 on github are not normally accessible. I played a bit with the compilation configuration and managed to circumvent it:

[WARNING] /Users/wojtek/dev/tigase/tigase-utils/src/main/java/tigase/cert/OldSelfSignedCertificateGenerator.java:[20,25] sun.security.x509.AlgorithmId is internal proprietary API and may be removed in a future release
[WARNING] /Users/wojtek/dev/tigase/tigase-utils/src/main/java/tigase/cert/OldSelfSignedCertificateGenerator.java:[21,25] sun.security.x509.CertificateAlgorithmId is internal proprietary API and may be removed in a future release

But then ran into problems with other modules/packages. It seems like it would be doable (at least for now, hopefully until proper API is introduced) but it would require more tweaking (and possibly converting tigase-utils and tigase-xmltools to module system -- which we also have on our roadmap #kangaroo-62).

What do you say we should do? Try to still use internal APIs or just use BouncyCastle?

wojciech.kapcia@tigase.net commented 4 years ago

Actually, after fiddling some more with the configuration I managed to get it working. It involves profiles (so for JDK9 and onwards configuration is different) but it builds both under JDK8 and JDK9+, with the caveat that builds produced by newer JDKs won't be runnable on JDK8. But given that we still use JDK8 to build majority of the binaries (save for tigase-push) it will work just fine in overwhelming majority of cases.

In the future we can migrate do correct java.security. API when it's ready.

issue 1 of 1
Type
Bug
Priority
Blocker
Assignee
RedmineID
8813
Version
tigase-server-8.1.0
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-utils#19
Please wait...
Page is in error, reload to recover