SlickEdit Product Discussion > SlickEdit®

Java Modules, Java FX, and Live Errors

(1/3) > >>

I'm having difficulty with Java 17's modules, FX, and SlickEdit's live errors.

I'm building an application that uses Java FX extensively in Java 17.  In order to compile FX code, the options

   --module-path "C:\Program Files\Java\javafx-jmods-17.0.2" --add-modules javafx.controls,javafx.web,javafx.swing

must be included on the javac command line.  I have added these command-line options to the Build -> Java Options -> Compiler -> Other Options text field, and I am able to compile within SlickEdit.  However, I seem to be having difficulty getting Live Errors to use these options:

* If I select the Build -> Java Options -> Live Errors -> Use "Other Options" from Compiler Tab checkbox, then Live Errors quits working, and I can't find any indication of why.
* If I deselect the Build -> Java Options -> Live Errors -> Use "Other Options" from Compiler Tab checkbox, then Live Errors flags every reference to FX classes as "Symbol not found" or "Package does not exist".  This is the behavior I would expect if the command-line options are not included.
My code compiles okay outside of SlickEdit, so I don't think it is a coding error.

It should log an error in Message List if something has gone wrong.  But looking at the code that calls the compiler, I did find one place where errors that are not standard diagnostics would not be sent back to the editor, which isn't right.  I've attached an updated class that fixes that.  To apply it:

1) Exit SlickEdit
2) copy the attached RTECompiler.class file to YOUR_INSTALL_DIR\toolconfig\rte, overwriting the file that's already there.
3) Restart SlickEdit.

Go ahead and restart your project.  Give it a few seconds, and then check the Message List tool window for a error message.   (the message will very likely not be associated with a source file, so you have to look in the tool window rather than look for highlights in the source files).

Hopefully there will be an error message, and it will give us a direction to go in.

Update: I found one more place where an error can't be communicated, when an option isn't recognized by the compiler.   I found this by having the wrong JDK level for my Live Errors setup.

Attached is updated RTECompiler.class.

I made a quick project with JavaFX and openjdk 17, and I can get Live errors to resolve the module packages, so it can work.  There's just some problem that isn't being reported by the original RTECompiler.class.

You gave me some hints about where to look, and this is what I found:

* The Build->Java Options->Compiler->Other options field has --module-path "C:\Program Files\Java\javafx-jmods-17.0.2" --add-modules javafx.controls,javafx.web,javafx.swing
* When I select Build->Java Options->Compiler->Live Errors->Use "Other Options" from Compiler Tab check box, the Message List window has only one error:  Unrecognized option: Files\Java\javafx-jmods-17.0.2"
So it looks like some process is not handling quoted options properly.

Oddly enough, the arguments are getting to the compiler harness intact, but the code there is not honoring any quotes put around the path with the spaces in it when breaking the arguments down for the compiler API.   I'll post an updated RTECompiler.class when I've fixed it.


[0] Message Index

[#] Next page

Go to full version