Use System.getProperty("java.class.path") to obtain the Java class path.
package com.thb;
import java.io.IOException;
public class Test5 {
public static void main(String[] args) throws IOException {
System.out.println(System.getProperty("java.class.path"));
}
}
Output when running under eclipse:
Output when running under cmd:
The output "." indicates the current directory.