0

I've been trying to compile and run this example for javafx  https://openjfx.io/openjfx-docs/#maven using Cygwin on Windows 10.  It took awhile to get past the compile because my javafx is stored in C:\Program Files\javafx-sdk-13.0.1, the trouble being the space in the folder name.  After trying lots of different things I finally found How to cd into a directory with space in the name?, which in a nutshell tells you to put quotes around your environment variable, "PATH_TO_FX". 

Then I tried to run the example 

$ java --module-path "PATH_TO_FX":mods -m hellofx/hellofx.HelloFX

Error occurred during initialization of boot layer​java.nio.file.InvalidPathException: Illegal char <:> at index 10: PATH_TO_FX:mods​

So I thought the PATH_TO_FX was the problem but it turns out it is not.

$ java --module-path src:mods -m hellofx/hellofx.HelloFX

Error occurred during initialization of boot layer​java.nio.file.InvalidPathException: Illegal char <:> at index 3: src:mods​

src is a valid directory and I still get the same problem.  I think it is related to java being stored in a directory with spaces in it but I'm not sure.

Ray_Write
  • 131
  • 2
  • 12

2 Answers2

0

@Ray_Write

isn't ; for Windows? Cygwin uses bash

This has nothing to do with the shell. The parsing of --module-path is handled entirely by the java interpreter, and according to the docs uses ; on Windows instead of :, presumably for congruence with Windows PATH separators.

Since this Java installation is a native Windows application and not one built for Cygwin, one should still use ;. So in effect, this has nothing to do with Cygwin.

For passing file paths to java you may also need to use cygpath to convert the path to its native Windows path.

Iguananaut
  • 21,810
  • 5
  • 50
  • 63
0

You're right @Iguananaut, I do need a semi colon, to get my example to work I had to escape it.

java --module-path "$PATH_TO_FX"\;mods -m hellofx/hellofx.HelloFX

where PATH_TO_FX is in .bash_profile as

PATH_TO_FX="C:/Program Files/javafx-sdk-13.0.1/lib"

Ray_Write
  • 131
  • 2
  • 12