tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Jodd > Commons > How to get default classpath

How to get default classpath 

Jodd is an open-source java library with lot of reusable components and feature rich utilities. This requires the library jodd-3.3.2.jar to be in classpath. The following example shows how to use ClassLoaderUtil.getDefaultClasspath() API.

File Name  :  
Author  :  Sudhakar KV
Email  :  [email protected]
package com.bethecoder.tutorials.jodd.cls;


import jodd.util.ClassLoaderUtil;

public class GetClassPathTest {

   @param args
  public static void main(String[] args) {
    File [] clspaths = ClassLoaderUtil.getDefaultClasspath();
    for (File clspath : clspaths) {


It gives the following output,
C:\Program Files\Java\jdk1.6.0_10\jre\lib\ext\sunjce_provider.jar
C:\Program Files\Java\jdk1.6.0_10\jre\lib\ext\localedata.jar
C:\Program Files\Java\jdk1.6.0_10\jre\lib\ext\dnsns.jar
C:\Program Files\Java\jdk1.6.0_10\jre\lib\ext\sunpkcs11.jar
C:\Program Files\Java\jdk1.6.0_10\jre\lib\resources.jar;
	C:\Program Files\Java\jdk1.6.0_10\jre\lib\rt.jar;
	C:\Program Files\Java\jdk1.6.0_10\jre\lib\sunrsasign.jar;
	C:\Program Files\Java\jdk1.6.0_10\jre\lib\jsse.jar;
	C:\Program Files\Java\jdk1.6.0_10\jre\lib\jce.jar;
	C:\Program Files\Java\jdk1.6.0_10\jre\lib\charsets.jar;
	C:\Program Files\Java\jdk1.6.0_10\jre\classes
C:\Program Files\Java\jdk1.6.0_10\jre\lib\ext\sunmscapi.jar


bl  br