wiki:waue/java

Version 1 (modified by waue, 12 years ago) (diff)

--

取得執行路徑

  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