OpenJDK still unsupported? "cannot find symbol sun.misc.BASE64Encoder"

Package versions

maven 3.6.0
openjdk-8-jdk 8u282-b08
snap-engine 8.0.3

Commands ran

mvn clean install -Dmaven.test.skip=true
...

[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ ceres-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 89 source files to /root/snap-engine-8.0.3/ceres-core/target/classes
[INFO] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/ConfigurationElementImpl.java: Some input files use or override a deprecated API.
[INFO] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/ConfigurationElementImpl.java: Recompile with -Xlint:deprecation for details.
[INFO] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/ConfigurationElementImpl.java: Some input files use unchecked or unsafe operations.
[INFO] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/ConfigurationElementImpl.java: Recompile with -Xlint:unchecked for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/ModuleResolver.java:[379,42] reference to Module is ambiguous
  both interface com.bc.ceres.core.runtime.Module in com.bc.ceres.core.runtime and class java.lang.Module in java.lang match
[ERROR] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/UrlHelper.java:[69,17] cannot find symbol
  symbol:   class BASE64Encoder
  location: package sun.misc
[ERROR] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/UrlHelper.java:[69,60] cannot find symbol
  symbol:   class BASE64Encoder
  location: package sun.misc
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] SNAP Engine Project 8.0.3 .......................... SUCCESS [ 43.390 s]
[INFO] SNAP Test Utils 8.0.3 .............................. SUCCESS [ 16.794 s]
[INFO] Ceres Runtime Library 8.0.3 ........................ FAILURE [  6.454 s]
[INFO] Ceres Binding 8.0.3 ................................ SKIPPED

...

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project ceres-core: Compilation failure: Compilation failure:
[ERROR] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/ModuleResolver.java:[379,42] reference to Module is ambiguous
[ERROR]   both interface com.bc.ceres.core.runtime.Module in com.bc.ceres.core.runtime and class java.lang.Module in java.lang match
[ERROR] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/UrlHelper.java:[69,17] cannot find symbol
[ERROR]   symbol:   class BASE64Encoder
[ERROR]   location: package sun.misc
[ERROR] /root/snap-engine-8.0.3/ceres-core/src/main/java/com/bc/ceres/core/runtime/internal/UrlHelper.java:[69,60] cannot find symbol
[ERROR]   symbol:   class BASE64Encoder
[ERROR]   location: package sun.misc
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :ceres-core

No, OpenJDK is supported.
Which distribution are you do you use? In the one from Adopt for example the Base64Encoder is still available.

Maybe maven uses Java11 or a later version?

Try mvn --version

However, I replaced the usage. As it needs to be replaced anyway.
So it should compile now.

I’ve installed the AdoptOpenJDK version, and compilation worked

$ mvn -version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 1.8.0_282, vendor: AdoptOpenJDK, runtime: /root/jdk8u282-b08/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "5.4.0-1039-aws", arch: "amd64", family: "unix"
1 Like

A reminder for this issue, the change to replace BASE64Encoder (replaced usage of sun.misc.BASE64Encoder by java.util.Base64 · senbox-org/snap-engine@d7001da · GitHub) is yet to be included in any tagged snap-engine release. Thanks.

Hi,
I don’t understand your reminder. You have linked the commit where the change was done, and it will be included in the next SNAP9 release.
Is there something I have overlooked?

No. Sorry, i assumed it was to be included in a SNAP8 minor release. Thanks.