I have an Oracle Form running on the client's workstation. When the JVM that loads the form is started we have a several jar files loaded into the JVM classpath. 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:
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"));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.