Use
System.getProperty("java.class.path")
see http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html
You can also split it into it's elements easily
String classpath = System.getProperty("java.class.path"); String[] classpathEntries = classpath.split(File.pathSeparator);
2.1m questions
2.1m answers
60 comments
57.0k users