wiki:waue/java

取得執行路徑

  System.out.println( Main.class.getName()  );
    
  System.out.println( Thread.currentThread().getContextClassLoader()
        .getResource(Main.class.getName().replace(".", "/") + ".class") );
  
purejava.Main
file:/home/waue/workspace/eclipse36ee/waue/bin/purejava/Main.class
Last modified 13 years ago Last modified on Feb 7, 2012, 4:57:21 PM