Strange issue with getResourceAsStream()

Steve D. Perkins general@steveperkins.net
Wed Jul 2 17:43:00 GMT 2003


Erik Poupaert wrote:
...
 > I regularly use getResourceAsStream() by myself, and I don't have any
 > problems with it. There are potentially two reasons why you're having 
 > this problem.
 >
 > One. You're linking statically, and the SWT library sources have not
 > been patched to force reflection to work.


	That was it.  I added your extra 5 lines to FileFormat.java, and the 
issue went away.  Thanks alot!

	I don't want to stray TOO far from the topicality of GNU tools here 
(although I suppose it could be argued that SWT is a dominant topic in 
GCJ circles).  However, I've got a couple of questions for you Erik (or 
anyone else who compiles and static-links SWT with GCJ):

- What all patches HAVE you applied to your SWT codebase, to facilitate 
compilation and static linking?  I knew about the obvious patches to 
Library.java, removing calls to "System.loadLibrary(...)".  However, 
this was the first mention I've heard about the need for patching 
FileFormat.java.  Are there any other issues you've run across yet and 
patched yourself?

- Would the 5 lines added to FileFormat.java have any negative effect on 
non-static linking?  I'm wondering if it would be safe to sumbit this as 
a patch to the Eclipse folks, or if it is something very static-specific 
like those "System.loadLibrary(...)" calls.

Steve




More information about the Java mailing list