Why cannot run compiled JavaFX 11 class?
Steve Hannah
steve at weblite.ca
Tue Oct 30 21:17:59 UTC 2018
The "java" command expects a fully-qualified class name, not a file path as
its argument.
E.g.
cd /Users/me/Documents/java
java --module-path $PATH_TO_FX --add-modules=javafx.controls HelloFX
On Tue, Oct 30, 2018 at 2:06 PM Murray Eisenberg <murray at math.umass.edu>
wrote:
> This is under macOS Mojave (10.14).
>
> Following instructions at https://openjfx.io/openjfx-docs/#install-javafx,
> I compiled the sample HelloFX.java via:
>
> javac --module-path $PATH_TO_FX --add-modules=javafx.controls
> /Users/me/Documents/java/HelloFX.java
>
> But now if I attempt to run that...
>
> java --module-path $PATH_TO_FX --add-modules=javafx.controls
> /Users/me/Documents/java/HelloFX
>
> ... I get error:
>
> Error: Could not find or load main class
> .Users.me.Documents.java.HelloFX
> Caused by: java.lang.ClassNotFoundException:
> /Users/me/Documents/java/HelloFX
>
> Yet the file reported as not found is there:
>
> ls -l /Users/me/Documents/java/HelloFX.class
> -rwxr--r-- 1 me staff 1336 Oct 30 16:01
> /Users/murray/Documents/java/HelloFX.class
>
> (I had already changed permissions to add `u+x` in case that was the
> issue, but apparently that was not the trouble.
>
> What's wrong?
>
> (Yes, `$PATH_TO_FX` does point to `javafx-sdk-11/lib`.)
>
> ——
> Murray Eisenberg murray at math.umass.edu
> Mathematics & Statistics Dept.
> University of Massachusetts Amherst
>
>
>
>
>
--
Steve Hannah
Web Lite Solutions Corp.
More information about the openjfx-dev
mailing list