How to wildcard include JAR files when compiling?
compilation, jar, java, package
Solution
your command line is correct, but there are some considerations:
- you must have javac >= 1.6, because only in that version the compiler parses the "*" as various JAR files.
- you must be running Windows, because ";" is the path separator for that operating system only (it doesn't work on Unix, the path separator on Unix is ":").
I'm assuming that the JAR file has the proper directory structure as you stated.
Problem
I have the following in a java file (MyRtmpClient.java): ``` import org.apache.mina.common.ByteBuffer; ``` and `ByteBuffer` is inside a JAR file (with the proper directory structure of course). That jar file and others I need are in the same directory as the .java file. Then I compile with the line: ``` javac -cp ".;*.jar" MyRtmpClient.java ``` But I get the error: `MyRtmpClient.java:3: package org.apache.mina.common does not exist import org.apache.mina.common.ByteBuffer;` How can I include jar files in my project?