I am trying to run a simple java class using Windows command line. I have set JAVA_HOME and added it to the System path variable.
I have multiple jars in different folders and I am trying to add all of them using classpath using the below command. However when "*" is used, only the first path is picked by classpath and it is ignoring the remaining paths though I am using the ";" character. It does not work if the path uses the "/" separator. Is it possible to specify paths to multiple folders that have jar files and compile from a command line
javac -verbose -classpath "C:\Program Files\lib\java\core\*; C:\Program Files\lib\java\core\locale\*; C:\Program Files\lib\java\modules\*; C:\Program Files\lib\java\modules\ext\*;" testClass.java
Ultimately I want to use this classpath setup in an ant script in netbeans project properties to simplify the setup.
-classpath folder\*. That is, dont't forget the slash before*;. Whitespace is not ignored in a classpath. (And put a directory separator before each asterisk, as Daniele said.)