为类路径设置文件夹 [英] Set folder for classpath

查看:23
本文介绍了为类路径设置文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在命令行中设置 Java CLASSPATH 选项以指向一个或多个包含多个 jar 文件的目录?是否有支持递归目录和子目录的通配符?

From the command line, how do I set the Java CLASSPATH option to point to one or more directories containing multiple jar file? Are there wildcards for recursive directory and sub-directory support?

(我的 JAR 文件被分类在几个子目录中.)

(My JAR files are sorted in several sub-directories.)

推荐答案

如果您使用的是 Java 6 或更高版本,您可以使用以下形式的通配符:

If you are using Java 6 or higher you can use wildcards of this form:

java -classpath ".;c:mylibs*;c:extlibs*" MyApp

如果你想添加所有子目录:liba, lib, libc,除了:

If you would like to add all subdirectories: liba, lib, libc, there is no mechanism for this in except:

java -classpath ".;c:liba*;c:lib*;c:libc*" MyApp

对于您想要完成的工作类型,没有比 lib**lib** 通配符更适合的东西.

There is nothing like lib** or lib** wildcard for the kind of job you want to be done.

这篇关于为类路径设置文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆