How to wildcard include JAR files when compiling?

后端 未结 9 660
面向向阳花
面向向阳花 2020-12-01 05:30

I have the following in a java file (MyRtmpClient.java):

import org.apache.mina.common.ByteBuffer;

and ByteBuffer is inside a

相关标签:
9条回答
  • 2020-12-01 05:49

    In Java 8, the option ".;*" etc. which are mentioned above did not seem to work. I tried and found that : javac -cp '<location of jars>/*' MyRtmpClient.java

    works:

    <location of jar> can be /usr/local/classes/* or /home/developer/MyProject/*

    0 讨论(0)
  • 2020-12-01 05:50

    Probably below syntax will work on windows dos command

    javac -cp ".;first.jar;second.jar;third.jar" MyRtmpClient.java
    
    0 讨论(0)
  • 2020-12-01 05:55

    javac does not understand *.jar in the classpath argument. You need to explicitly specify each jar. e.g.

    javac -cp ".;mina.jar" MyRtmpClient.java
    
    0 讨论(0)
提交回复
热议问题