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

问题内容:

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?

P.P.S Checked sources – javapackager from JDK 9.0.1 is totally broken! Use executable file from Java 8.

问题评论:

    
Have you checked your environment settings ?
    
The fact that running from a specific path works implies this path is not that of your default Java installation. You could try using update-alternatives to make sure this is the default Java: askubuntu.com/questions/121654/how-to-set-default-java-versi‌​on
    
My environment is Ok. I have an only Java installation (Oracle’s JDK 9.0.1). All compilers and java programs (including JavaFX) works perfectly. When I specify an absolute path to javapackager it changes nothing.
– user3544995
39 mins ago

原文地址:

https://stackoverflow.com/questions/47755705/java-9-javapacker-cant-find-jfxrt-jar-while-creating-bss-seems-totally-broken

添加评论