This isn't a bug, per se. More of a tip for anyone using Java 9 who's encountered this error:
[info] delivering ivy file to /Users/myuser/Projects/my-project/target/scala-2.12/ivy-0.0.1-SNAPSHOT.xml
[error] java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
[error] at com.amazonaws.util.Md5Utils.md5AsBase64(Md5Utils.java:104)
[error] at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1636)
[error] at ohnosequences.ivy.S3Repository.put(S3Repository.java:248)
…
[error] Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
[error] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
[error] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
[error] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
[error] at com.amazonaws.util.Md5Utils.md5AsBase64(Md5Utils.java:104)
[error] at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1636)
[error] at ohnosequences.ivy.S3Repository.put(S3Repository.java:248)
…
(Truncated and redacted.)
It's caused aws/aws-sdk-java#1092 and can be easily worked-around thanks to a tip by @jayeshja. In short, passing --add-modules=java.xml.bind,java.activation to Java resolves it.
Two ways this is accomplished with SBT are:
- Adding the flag to an
.sbtopts file in your project's root with:
-J--add-modules=java.xml.bind,java.activation
- Appending the
SBT_OPTS environment variable with:
--add-modules=java.xml.bind,java.activation
This isn't a bug, per se. More of a tip for anyone using Java 9 who's encountered this error:
(Truncated and redacted.)
It's caused aws/aws-sdk-java#1092 and can be easily worked-around thanks to a tip by @jayeshja. In short, passing
--add-modules=java.xml.bind,java.activationto Java resolves it.Two ways this is accomplished with SBT are:
.sbtoptsfile in your project's root with:SBT_OPTSenvironment variable with: