Compiling using javac

Graham Norris work at norrisfamily.org
Thu Oct 11 11:34:35 UTC 2018


** Reply to message from Abhinay Agarwal <abhinay_agarwal at live.com> on Wed, 10
Oct 2018 09:49:06 +0000

Abhinay,

I've found I actually had two problems.

The later one was while trying to get the sample to compile: --module-path will
not tolerate a trailing "\" on the path. It doesn't reject it, it just makes it
not work.

My original problem turned out to be the fact that --module-path in a parm file
requires "/", not "\", even on Windows. Again, not rejected, just doesn't work.

Thanks for your help.

Graham.

> Hi Graham,
> 
> The error "module not found: javafx.controls" can be caused when env variable
> 'PATH_TO_FX' is targeting the 'JavaFX SDK' instead of 'JavaFX SDK/lib' directory
> 
> The following works for me on a Windows machine:
> 
> > set JAVA_HOME="C:\Program Files\Java\jdk-11"
> > set PATH_TO_FX="C:\Program Files\Java\javafx-sdk-11\lib"
> > %JAVA_HOME%\bin\javac --module-path %PATH_TO_FX% --add-modules=javafx.controls HelloFX.java
> > %JAVA_HOME%\bin\java --module-path %PATH_TO_FX% --add-modules=javafx.controls HelloFX
> 
> -- Abhinay
> 
> 
> On Oct 10 2018, at 2:59 pm, Graham Norris <work at norrisfamily.org> wrote:
> 
> ** Reply to message from Abhinay Agarwal <abhinay_agarwal at live.com> on Tue, 9
> Oct 2018 16:30:18 +0000
> 
> No stack trace from either type of failure, just error messages. I've tried
> compiling that example program, with the following result:
> 
> D:\pbmdev>dir HelloFX.java&set PATH_TO_FX&dir %PATH_TO_FX%javafx.*&javac
> --module-path %PATH_TO_FX% --add-modules=javafx.controls HelloFX
> Volume in drive D is DataVolume
> Volume Serial Number is 64B0-54F9
> 
> Directory of D:\pbmdev
> 
> 10/10/2018 10:19 642 HelloFX.java
> 1 File(s) 642 bytes
> 0 Dir(s) 80,740,716,544 bytes free
> PATH_TO_FX="c:\Program Files\Java\JDK-11.028\lib\"
> Volume in drive C is System
> Volume Serial Number is 5EC2-1518
> 
> Directory of c:\Program Files\Java\JDK-11.028\lib
> 
> 13/09/2018 15:57 749,886 javafx.base.jar
> 13/09/2018 15:57 2,511,103 javafx.controls.jar
> 13/09/2018 15:57 127,394 javafx.fxml.jar
> 13/09/2018 15:57 4,292,697 javafx.graphics.jar
> 13/09/2018 15:57 270,594 javafx.media.jar
> 13/09/2018 15:57 71 javafx.properties
> 13/09/2018 15:57 119,848 javafx.swing.jar
> 13/09/2018 15:57 712,651 javafx.web.jar
> 8 File(s) 8,784,244 bytes
> 0 Dir(s) 41,713,242,112 bytes free
> error: no source files
> 
> D:\pbmdev>
> 
> Hi Graham,
> 
> Its really difficult to help without checking out the failing command first.
> 
> Could you reply back with the "javac" command you are trying to execute, along with the stacktrace?
> 
> -- Abhinay
> ________________________________
> From: openjfx-dev <openjfx-dev-bounces at openjdk.java.net> on behalf of Graham Norris <work at norrisfamily.org>
> Sent: Tuesday, October 9, 2018 9:39 PM
> To: openjfx-dev at openjdk.java.net
> Subject: Re: Compiling using javac
> 
> ** Reply to message from Michael Paus <mp at jugs.org> on Tue, 9 Oct 2018 15:47:29
> +0200
> 
> Thank you, I'd already found this, but it isn't exactly "documentation." Also,
> it is for Linux (Windows doesn't have export,) but I have put the path directly
> on the --module-path option, which should be equivalent for this.
> 
> Crucially, it does not work: I get "error: module not found: javafx.controls"
> I'm not entirely sure why I'd use javafx.controls as my application does not
> use that, but not finding javafx.controls seems to be unrelated to lack of use,
> which is also borne out by the fact that the compile fails immediately rather
> than churning out dozens of errors as it tries to compile things.
> 
> Graham.
> 
> The documentation you are looking for can be found here:
> https://openjfx.io/openjfx-docs/
> 
> Am 09.10.18 um 15:32 schrieb Graham Norris:
> I have an existing Java application which uses JavaFX. It is currently compiled
> (on Windows) and working using Oracle's Java 10 JDK. I am now trying to get it
> to compile using OpenJDK 11 and OpenJFX 11, and failing miserably!
> 
> I use the JDK's command line tools to compile the application and haven't
> managed to find anything which shows how to make the combination of an existing
> application, OpenJDK 11 and OpenJFX 11 compile. Basically, I can't get javac to
> find and use either OpenJFX's jmods or jars.
> 
> I feel there should be somewhere I could read instructions on how to use
> OpenJFX with OpenJDK 11's javac, but if there is, I just can't find it!
> 
> Any help appreciated.
> 
> Graham.


More information about the openjfx-dev mailing list