13

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 ?

3 Answers 3

38

Separate the class path entries by : colons, not spaces.

Sign up to request clarification or add additional context in comments.

1 Comment

For Windows user, ; should be used instead of :.
1

Also you should use '/' instead of '\' as directory separator.

Comments

1

Also use quotation marks " to specify a classpath when using Powershell:

 javac -cp ".;folder1\folder2\b.jar" Test.java

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.