Java 9 javapacker can't find jfxrt.jar while creating bss'. Seems totally broken in “createbss” mode under Linux. How to avoid the bug?

℡╲_俬逩灬. 提交于 2019-12-21 20:36:24

问题


I have Ubuntu Linux system with Sun JDE 9.0.1 and I need to convert some of Fx's CSS files to binary form from console. But when I execute the command:

javapackager  -createbss -outdir . -srcdir .

I got an error:

Error: jfxrt.jar needs to be on classpath for -createbss and for -createJar without -nocss2bin

My JDK is properly installed. I have all necessary modules (including FX). Any ideas how I can avoid a stupid bug and I make the packager to do it's job? If I run javapackager from "/usr/lib/jvm/java-9-oracle/jmods" directory it completes without error. So right now I am using an ugly fix, search the modules directory, make it current, run packager from there. But that's damn ugly. javapackager doesn't accept any other parameters but outdir, srcdir and srcfiles so I can't force loading or looking path for the jfx module. But may there is some trick with environment variables or something that can make the fix less ugly?

P.S. Running from jmod directory or removing "-srcdir" from the parameters eliminates the error, but the packager doesn't generate any output files (even if I specify input files with "-srcfiles"). Seems as javapackager is completely broken in createbss mode. Does anyone use it with Java 9?


回答1:


I've checked the sources - javapackager from JDK 9.0.1 is totally broken! Use executable file from Java 8. I filled out a bug report to Oracle and all of a sudden they were very surprised (nobody noticed that one of the basic function ot a core tool is broken yet?!).

TEMPORARY SOLUTION: Use the javapackaged tool from JDK 1.8. All you need is the executable itself and you can put at any place. I put it right into my project tree (under "tools" directory) and call from a building script. WARNING! Use this replaced executable for "createbss" ONLY! Use the regular one for all other things!



来源:https://stackoverflow.com/questions/47733618/creating-bss-files-from-css-in-javafx-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!