I created a desktop game in eclipse using Libgdx. The game runs great in eclipse, however the FileHandle list()
method doesn't work when exported to a jar file. I used the following lines of code:
songFiles = Gdx.files.internal("./bin/" + "songs/").list();
System.out.println(songFiles[0]);
Again, in eclipse it prints the file location.However when exported to a jar, I get a java.lang.ArrayIndexOutOfBoundsException: 0
error.
Cannot export default Java libGDX project as a jar from Eclipse looks similar to the issue that I am having