Get classpath using System class
- /*
- Get classpath using System class
- This example shows how to get the classpath using
- System class.
- */
- public class PrintClassPath {
- public static void main(String[] args) {
- /*
- * Get java.class.path system property using
- * public static String getProperty(String name) method of
- * System class.
- */
- String strClassPath = System.getProperty("java.class.path");
- System.out.println("Classpath is " + strClassPath);
- }
- }
- /*
- Output would be system dependent
- */



