I am currently making a small simple Java program for my Computer Science Final, which needs to get the path of the current running class. The class files are in the C:\\2013\\g
Try this.
import java.io.File; public class TT { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String path = TT.class.getResource("").getPath(); File file = new File(path); System.out.println(file.getAbsolutePath()); } }