Including all the jars in a directory within the Java classpath

前端 未结 24 3618
鱼传尺愫
鱼传尺愫 2020-11-21 04:25

Is there a way to include all the jar files within a directory in the classpath?

I\'m trying java -classpath lib/*.jar:. my.package.Program and it is no

24条回答
  •  被撕碎了的回忆
    2020-11-21 05:04

    Please note that wildcard expansion is broken for Java 7 on Windows.

    Check out this StackOverflow issue for more information.

    The workaround is to put a semicolon right after the wildcard. java -cp "somewhere/*;"

提交回复
热议问题