0

I was working home office with my linux box, was sure to write portable code. Used shell and gnumake and compiled java through

javac -Xlint:deprecation -Xlint:unchecked --module-path libs/nrjavaserial-4.0.1.jar:libs/jep-3.9.0.jar:libs/commons-beanutils-1.9.4.jar:libs/commons-collections-3.2.2.jar:libs/commons-logging-1.2.jar:src/  src/main/de/name/product/Product.java -d target/classes/

All ok. Now in office with windows 10 but still gnumake, does not work. Also from git bash, no.

I would be content as a first step to get it run in gitshell. I use javac 11.0.7 and 2.26.0.windows.1.

The errors (i cannot show in full because related to customer) show that no jar has been accepted:

 error: cannot find symbol
       NRSerialPort serial = getSingleSerialPort(baudRate);
        ^
  symbol:   class NRSerialPort
  location: class xxx

shows that libs/nrjavaserial-4.0.1.jar is not accepted athough present and

 error: cannot find symbol
        } catch(JepException e) {
                ^
  symbol:   class JepException
  location: class XXX

shows that libs/jep-3.9.0.jar is not accepted. Note that on linux all works fine on an ordinary bash shell.

Maybe separators wrong for windows? I always thought, separators are transparent on git bash? or only / but not :? I tried several combinations, without success.

I suspect all quite easy... right?

Reissner
  • 31
  • 2

1 Answers1

0

You've guessed right, you need to use different separators on Windows.

See https://docs.oracle.com/en/java/javase/13/docs/specs/man/javac.html

In the following lists of options, an argument of path represents a search path, composed of a list of file system locations separated by the platform path separator character, (semicolon ; on Windows, or colon : on other systems.) Depending on the option, the file system locations may be directories, JAR files or JMOD files.

If you want portability, ease-of-use and maintainability, use something like ant, maven or gradle.

GeertPt
  • 16,398
  • 2
  • 37
  • 61