将蜡染版本从1.5升级到1.11后,图像的栅格化失败,出现Java异常

时间:2019-06-24 09:41:12

标签: java batik rasterizing

我已将蜡染版本从1.5升级到1.11,并且在使用-onload选项对图像进行光栅化时,以下命令失败,并出现Java异常。蜡染包提供了我们过去用于栅格化的图像。

如果我删除onload选项,则以下命令可以正常工作,并且光栅化成功。

输出失败的命令

java -jar batik-rasterizer-1.11.jar -onload samples/3D.svg

About to transcode 1 SVG file(s)

Converting 3D.svg to samples/3D.png ... Exception in thread "main" java.lang.NoClassDefFoundError: org/mozilla/javascript/JavaScriptException
        at org.apache.batik.bridge.RhinoInterpreterFactory.createInterpreter(RhinoInterpreterFactory.java:82)
        at org.apache.batik.script.InterpreterPool.createInterpreter(InterpreterPool.java:124)
        at org.apache.batik.bridge.BridgeContext.getInterpreter(BridgeContext.java:566)
        at org.apache.batik.bridge.BaseScriptingEnvironment.getInterpreter(BaseScriptingEnvironment.java:318)
        at org.apache.batik.bridge.BaseScriptingEnvironment.loadScript(BaseScriptingEnvironment.java:450)
        at org.apache.batik.bridge.BaseScriptingEnvironment.loadScripts(BaseScriptingEnvironment.java:354)
        at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:214)
        at org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:92)
        at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
        at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)
        at org.apache.batik.apps.rasterizer.SVGConverter.transcode(SVGConverter.java:1002)
        at org.apache.batik.apps.rasterizer.SVGConverter.execute(SVGConverter.java:717)
        at org.apache.batik.apps.rasterizer.Main.execute(Main.java:937)
        at org.apache.batik.apps.rasterizer.Main.main(Main.java:990)
Caused by: java.lang.ClassNotFoundException: org.mozilla.javascript.JavaScriptException
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 14 more

Java版本详细信息

java -version openjdk版本“ 11.0.1” 2018-10-16 LTS OpenJDK运行时环境Zulu11.2 + 3(内部版本11.0.1 + 13-LTS) OpenJDK 64位服务器VM Zulu11.2 + 3(内部版本11.0.1 + 13-LTS,混合模式)

0 个答案:

没有答案