public static String getJarHome ( Object o ) { String path = o . getClass ( ) . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) . getFile ( ) ; File jarFile = new File ( path ) ; return jarFile . getParentFile ( ) . getAbsolutePath ( ) ; }
get the absolute parent path for the jar file .