How to add multiple .jar files in the javac/java class path - for Debian Linux.
Iam using,
javac -cp a.jar folder1\folder2\b.jar Test.java
But, it is giving Invalid flag error. Can anybody help me how to compile and run it ?
In general, to include all of the JARs in a given directory, you can use the wildcard * (not *. jar ). The wildcard only matches JARs, not class files; to get all classes in a directory, just end the classpath entry at the directory name.
To check our CLASSPATH on Windows we can open a command prompt and type echo %CLASSPATH%. To check it on a Mac you need to open a terminal and type echo $CLASSPATH.
Separate the class path entries by :
colons, not spaces.
Also you should use '/' instead of '\' as directory separator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With