I need to run a java command with a custom classpath.
On Windows I need to type:
java -cp foo;bar
On Linux I need to type:
java -cp foo:bar
We currently have a .bat file containing the first version and a .sh file containing the second version. This works fine most of the time, but fails for git-bash on Windows, which needs a shell script with a semicolon delimiter.
Is there any system independent way to write such a classpath?
I would think of something like
java -cp foo -cp bar
but this does not this way.
Currently the only way I see is having some shell logic determining the OS and generating the correct command line from that.
Is there an easier way to do this the java way?