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?
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