stchman
April 29th, 2011, 12:57 AM
Hello all. I have devised a way to return the absolute path that the .class file resides in. Does everyone agree or are there better ways.
import java.util.*;
import java.io.*;
public class ReturnPath {
public static void main( String[] args ) {
ReturnPath m = new ReturnPath();
m.getPath();
}
public void getPath() {
File f = new File( "" );
String pathName = f.getAbsolutePath();
System.out.println( pathName );
}
}
import java.util.*;
import java.io.*;
public class ReturnPath {
public static void main( String[] args ) {
ReturnPath m = new ReturnPath();
m.getPath();
}
public void getPath() {
File f = new File( "" );
String pathName = f.getAbsolutePath();
System.out.println( pathName );
}
}