1

I'm trying to find the simplest way to compile some Java code via Command Line while including multiple JAR files. This is what I've most recently tried and it does not seem to work.

javac -d bin -sourcepath src -cp lib/* ConfigToExcel.java 

The error I'm getting is

javac: invalid flag: lib/FIRST_JAR_FILE.jar

I'm sure there is a simple fix to this issue but I cannot seem to find it.

2
  • Windows or Unix based? If it's Windows, try changing the / to a \. Commented Jun 28, 2016 at 16:32
  • Or use something like ANT, SBT, Maven, etc. And make sure there's no spaces in any of your lib's jar file names. Commented Jun 28, 2016 at 16:39

1 Answer 1

1

Try with straight quotes (") with the classpath:

-cp "lib/*"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.