How to Get Class Path in a Java Application


Class Path is the Path used to find directories and JAR archives containing class files. Elements of the class path are separated by platform-specific characters. To get class path from a running java application, you may use the getProperty() method in System class. The following java code will show you how to get class path in java.

String classpath=System.getProperty("java.class.path");
System.out.println("Class path="+ classpath);

No comments:

Post a Comment