derek5. 2008-10-20 19:32 采纳率: 50%
浏览 3241

包括 Java classpath 中目录中的所有 jar

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 not able to find class files that are certainly in those jars. Do I need to add each jar file to the classpath separately?

转载于:https://stackoverflow.com/questions/219585/including-all-the-jars-in-a-directory-within-the-java-classpath

  • 写回答

22条回答 默认 最新

  • csdnceshi62 2008-10-20 19:36
    关注

    You need to add them all separately. Alternatively, if you really need to just specify a directory, you can unjar everything into one dir and add that to your classpath. I don't recommend this approach however as you risk bizarre problems in classpath versioning and unmanagability.

    评论

报告相同问题?