Error Linking java code with java/lang/StringBuffer.append
Dorling
Posts: 32
My java code Compile but will not Link i get the following error:
[noparse][[/noparse] Error JVM-0031] cannot find linked method (java/lang/StringBuffer.append).
The only place I am using a StringBuffer is below
The error Window said
Error: Cannot find linked method (%s.%s).
Description: The named method could not be found.
Solution: Report the error to technical support.
Many Thanks for any help
Jonathan
[noparse][[/noparse] Error JVM-0031] cannot find linked method (java/lang/StringBuffer.append).
The only place I am using a StringBuffer is below
private static char c; public static void getStringFromUser(StringBuffer s) { s.clear(); c = (char) Terminal.getChar(); while (c != '\r') { s.append(c); c = (char) Terminal.getChar(); } }
The error Window said
Error: Cannot find linked method (%s.%s).
Description: The named method could not be found.
Solution: Report the error to technical support.
Many Thanks for any help
Jonathan
Comments
import stamp.core.*;
at the top of your code.
regards peter
Post Edited (Peter Verkaik) : 6/2/2007 6:34:05 PM GMT
If that was the problem it would not Compile with jikes. It just can't Link the files so that it can download the files. I found out it was to do with this line it was to do with.
I have now change it. But if this was a problem why does it Compile. It is not a problem with normal java!!
Many Thanks
Jonathan
I can reproduce the error.
Channel.java uses synchronized keyword. Not supported by javelin.
Only there to keep compiler happy.
Removing it has no effect on link error (but remove it anyway).
I reprogrammed the StringBuffer as char[noparse]/noparse and resolved compiler errors.
The link error even then persists (though StringBuffer is not used anymore).
At this moment the best advice is to remove any code
that you added since your last succesful programming.
regards peter
Have you see my last post!
In pc java that means adding "true" or "false" I guess.
Note on adding Strings:
Don't do that at all for temporary purposes, the javelin has no garbage collection
so this will result in out of memory errors· eventually.
What happened here I think is that the Jikes compiler accepted the construction
as it is a normal pc java compiler. But the linker is written
for the javelin and as such sometimes chokes on generated bytecode
sequences, and this is probably one of those.
regards peter