#2982 [RFE] Java 9 Support
Closed: migrated 3 years ago by dmoluguw. Opened 6 years ago by tjaalton.

Debian/Ubuntu switched the default JDK to openjdk-9, as a stepping stone for 11 which is the next LTS version. This switch broke the build:

...
netscape/security/x509/RevocationReasonAdapter.java:20: error: package javax.xml.bind.annotation.adapters is not visible
import javax.xml.bind.annotation.adapters.XmlAdapter;
^
(package javax.xml.bind.annotation.adapters is declared in module java.xml.bind, which is not in the module graph)

running an old version built with JDK8 fails to start with this in catalina.out:

-Djava.endorsed.dirs=/usr/share/tomcat8/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


the second failure was actually due to old tomcat8.0, but looks like nuxwdog uses -Djava.endorsed.dirs, so that should be fixed

Metadata Update from @mharmsen:
- Custom field component adjusted to None
- Custom field feature adjusted to None
- Custom field origin adjusted to None
- Custom field proposedmilestone adjusted to None
- Custom field proposedpriority adjusted to None
- Custom field reviewer adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None
- Issue set to the milestone: 0.0 NEEDS_TRIAGE

6 years ago

there's also this warning with JDK8

com/netscape/security/util/IA5StringTest.java:8: warning: DerValue is internal proprietary API and may be removed in a future release
import sun.security.util.DerValue;

which is now gone:
error: module not found: sun.security

apparently the javax.xml.bind error can be worked around with:

--- dogtag-pki-10.5.5.orig/cmake/Modules/Java.cmake
+++ dogtag-pki-10.5.5/cmake/Modules/Java.cmake
@@ -80,6 +80,7 @@ function(javac target)
COMMAND ${Java_JAVAC_EXECUTABLE}
${CMAKE_JAVA_COMPILE_FLAGS}
-encoding UTF-8
+ --add-modules java.xml.bind
-cp ${native_classpath}
-d ${output_dir}
@${file_list}

but I'm not sure if that would create issues with runtime

Not sure about any runtime issue, but I think you can specify the --add-modules in the top-level CMakeLists.txt:

# Un-comment the following line to add 'javac' options (e. g. - "-g" debugging)
#set(CMAKE_JAVA_COMPILE_FLAGS "-g")

More docs on JDK9: http://openjdk.java.net/projects/jigsaw/talks/prepare-for-jdk9-j1-2016.pdf

but sun.security needs a replacement, it's not there anymore

so I'll just force jdk8 in the distro for the time being

The dependency on sun.security library will be fixed in ticket #3023.

https://java.com/en/download/release_notice.jsp

Public updates for Oracle Java SE 8 will remain available for individual, personal use through at least the end of 2020.

Public updates for Oracle Java SE 8 released after January 2019 will not be available for business, commercial or production use without a commercial license.

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/3100

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata Update from @dmoluguw:
- Issue close_status updated to: migrated
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata