java获取运行的jar(class)文件的路径

  String strURL = getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
  strURL 
= strURL.substring(0,strURL.lastIndexOf("/"));
  strURL 
+= "/"
posted @ 2008-11-28 17:27  轻松  阅读(1795)  评论(0编辑  收藏  举报