Compiling with JDK11
qwert2003 opened this issue · comments
When compiling the library jfreesvg with JDK11 I get the following error:
/[....]/org/jfree/graphics2d/svg/SVGGraphics2D.java:90: error: package javax.xml.bind is not visible
import javax.xml.bind.DatatypeConverter;
(package javax.xml.bind is declared in module java.xml.bind, which is not in the module graph)
Others seem to have similar issues, e.g. tomdesair/tus-java-server#14 (just found by searching). They say:
In JDK11 the javax.xml.bind package was removed. You use the javax.xml.bind.DatatypeConverter for Base64 encoding. Maybe you can replace this with java.util.Base64 from Java 8 or other implementation?
Not sure it is the same issue though. Any ideas?
Not sure why I never replied, but your suggestion was applied:
Will be included in the next release.
Hi,
This is a great library, and great to see the update for JDK 11. For this commit, it looks to me that
this.sb.append(Base64.getEncoder().encode(getPNGBytes(img)));
should rather be
this.sb.append(Base64.getEncoder().encodeToString(getPNGBytes(img)));
Otherwise, I find the default String representation of the byte array is written within the image, i.e. something like [B@210dfa10
rather than the actual String.
You are correct. Fixing this now.