A recurring problem is access to resources. If the host operating system is Windows, one type of filepath works; if Linux, a different one works. The solution offered by Java appears to be ClassLoader, in which, as I understand it, the resource is placed somewhere in the classpath, after which the operation classLoader.getResourceAsStream(resource_name); obtains the resource ready to be read as a stream.
In an application, I have successfully used it and the application works under both 'java' and 'javaw' commands. Then I wanted to use a java-to-exe program so that my infrequent users need not download and install the JRE. The first step of the process is to get the thing to work at all under the java-to-exe software, after which I would attack bundling it up.
I chose Winrun4j, and the program starts successfully under it. All normal program functions work, since they do not depend upon anything external, but the following depends upon locating resources using the ClassLoader:
o The HelpSet, upon which the Help system is based
o Log4j Properties, upon which logging is based.
o The About text for the About box.
These do not work.
It may be possible to repackage things for Winrun4j so that these dependencies are added separately and explicitly, and to add command-line arguments to convey the information to the program, but it is inelegant and clumsy, and undoes the good design of ClassLoader. Plus it would need changing when transitioning between Windows, Linux, other operating systems.
A further note: I looked for a way to ask the folks at WinRun4J about this, but although they have a blog, I cannot find how to post to it, or reach them in any other way. So if there is no direct WinRun4J knowledge available, even a way to contact them would be useful.
Any and all ideas or corrections of understanding are gratefully appreciated.