I need to get res folder to compile when I export a executable jar file in eclipse also when I use the getClass().getResource() method it doesn\'t work.
your path is wrong, you should get an error message if so, check it to see what path it actually tries, might not be what you think. Or debug and see what path it tries or even just print the path it tries.
or
it's not in the jar. Check the jar file with a zip-program and/or rename it to have zip in the and open it to check that the file is really there.