import java.io.File;
public class Main {
public static void main(String[] args) {
System.out.println(new File(System.getProperty("user.dir") + "/src/FileT.txt").exists());
}
}
Prints true when ran through the IDE
Prints false when compiled into a jar