The RuntimeMXBean.getClassPath()
returns the Java class path that is used by the system class loader to search for class files. This method is equivalent to System.getProperty("java.class.path")
.
Multiple paths in the Java class path are separated by the path separator character of the platform of the Java virtual machine being monitored.
package org.kodejava.example.management;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
public class GetClassPath {
public static void main(String[] args) {
RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
String classPath = bean.getClassPath();
System.out.println("ClassPath = " + classPath);
}
}
Latest posts by Wayan (see all)
- How do I install Calibri font in Ubuntu? - January 24, 2021
- How do I create a generic class in Java? - January 1, 2021
- How do I convert java.util.TimeZone to java.time.ZoneId? - April 25, 2020