简体   繁体   English

发出打印当前项目类路径//如何打印类路径中的所有目录和库?

[英]issue printing current project classpath // How can I print all directories and libraries in the classpath?

I have an Oracle Form running on the client's workstation.我在客户的工作站上运行了一个 Oracle 表单。 When the JVM that loads the form is started we have a several jar files loaded into the JVM classpath.当加载表单的 JVM 启动时,我们有几个 jar 文件加载到 JVM 类路径中。 I am trying to print the content of the classpath in one of the jars being loaded to the JVM, but every time is being printed only the one below:我正在尝试在加载到 JVM 的 jars 之一中打印类路径的内容,但每次只打印以下内容:

classpath= C:\Program Files (x86)\Java\jre1.8.0_281\lib\deploy.jar

I used several ways one of them is this one我用了几种方法,其中一种就是这个

ClassLoader cl = ClassLoader.getSystemClassLoader();

URL[] urls = ((URLClassLoader)cl).getURLs();

for(URL url: urls){
    System.out.println(url.getFile());
}

The question is How can I print all directories and libraries in the classpath not only a single library?问题是如何打印类路径中的所有目录和库而不仅仅是一个库?

Does this answers your question?这能回答你的问题吗?

System.out.println(System.getProperty("java.class.path"));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM