Our eclipse project roughly shows the following folders:
application - src - JRE System Library [1.6] - Referenced Libraries - lib - rsc
In our project, we would like to use File> Export ...> Executable JAR
Well, that works fine, with a few exceptions: if we want to run our application.jar, we still need to copy the rsc / folder in the same place as application.jar.
In rsc / we have other folders to separate the different parts. Basically, we load fragments using the code (well, a bit has changed, but the style of the path is correct)
strUrl = "file:rsc/properties/Constants.properties"; url = new URL(strUrl); ImageIcon icon = new ImageIcon(url);
I could right-click on rsc / "> Build Path> Use as Source Folder.
But this does not work, because eclipse does not automatically copy the rsc folder to the trash / folder. And then we can no longer run it from the terminal (not packaged in a jar)
EDIT : why can't eclipse handle this correctly? Why is he having problems with "nested" output folders? On the Source tab of the Build Path dialog box, I could easily add an rsc / panel with the output folder set to bin / rsc /, but it doesn't seem to be able to put subfolders ...
EDIT 2 . Now I managed to create an xml file for assembling the material using ant and somehow managed to include the rsc folder directly in the jar. Still not working due to the same errors. I really need to check resource paths, are they in the JAR or not? The contents of the JAR are now as follows:
META-INF/ META-INF/MANIFEST.MF configurator/ controller/ editor/ gui/ logic/ networking/ rsc/ rsc/gamesettings/ rsc/levels/ rsc/pics/ rsc/properties/ util/
but Java still hates me and throws java.io.FileNotFoundException: rsc/properties/Constants.properties with stacktrace for about 100 lines.
Does anyone know how to do this? thanks and considering
eclipse executable-jar ant java-6
Atmocreations
source share