Re: [javaCompiler-users] Accessing Resources [getResourceAsStream]
Status: Beta
Brought to you by:
soapy
From: Marco T. <mt...@gm...> - 2006-11-22 19:30:51
|
kas...@gm... wrote: > Hello, > > How can external resources, such as image files (gif or jpegs) be > referenced by the final .exe build in a Java class? I tried using > "getResourceAsStream" as the normal way of accessing resources using a > class but it could not find the resource. There are two possibilities: 1. compile it into the binary Add the files into a jar and add that jar to the compilation project. It will be included into the binary. 2. keep it outside of the binary Just don't compile it into the binary and put it in the correct path... Both ways work exactly as using a Java JRE itself. The only thing to remember is that you have to put the ressources into a jar when you wish to compile them into a binary. Marco |