jfree / jfreesvg

A fast, lightweight Java library for creating Scalable Vector Graphics (SVG) output.

Home Page:http://www.jfree.org/jfreesvg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

2e6cd5f

Will be included in the next release.

commented

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.