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);
More Related Contents:
- Java code doesn't work [closed]
- How does array work? How to create a basic array data structure using java? [closed]
- For Loop different type on how to code [closed]
- Code after if block inside a for loop doesn’t work
- What are static factory methods?
- Why to use Interfaces, Multiple Inheritance vs Interfaces, Benefits of Interfaces?
- Eclipse error: “The import XXX cannot be resolved”
- How to read a file from jar in Java?
- JPA : How to convert a native query result set to POJO class collection
- What’s the difference between fx:id and id: in JavaFX?
- Background timer task in JSP/Servlet web application [duplicate]
- Selenium switch focus to tab, which opened after clicking link
- The method getDispatcherType() is undefined for the type HttpServletRequest
- Dynamic code execution
- What is the difference between JDK dynamic proxy and CGLib?
- Is this a bug in Files.lines(), or am I misunderstanding something about parallel streams?
- Is it worth to use slf4j with log4j2
- javac error: Class names are only accepted if annotation processing is explicitly requested
- How can we redirect a Java program console output to multiple files?
- Is the Swing repaint() method still safe to use outside the EDT in Java 7+?
- How to map a nested value to a property using Jackson annotations?
- Uninitialized object leaked to another thread despite no code explicitly leaking it?
- Limited selection in a JTextField/JTextComponent?
- Will the jit optimize new objects
- Why are the Level.FINE logging messages not showing?
- Disabling contextual LOB creation as createClob() method threw error
- Android – onRequestPermissionsResult() is deprecated. Are there any alternatives?
- Deprecated createCriteria method in Hibernate 5
- What’s the difference between this and Activity.this
- When to log a stacktrace for a caught exception