I want to be able to list the files in the current directory. I\'ve made something that should work but doesn\'t return all the file names.
File dir = new File(\
Your code gives expected result,if you compile and run your code standalone(from commandline). As in eclipse for each project by default working directory is project directory that's why you are getting this result.
You can set user.dir property in java as:
System.setProperty("user.dir", "absolute path of src folder");
then it will give expected result.