17 November 2005 - java_dev (original) (raw)
Here's my issue... I think there's something wonky with my IDE's setup. I'm using JBuilder 2005, and the 1.5 JDK (specifically java version 1.5.0_05-b05).
Anyways, I'm having trouble with formatting things. I've tried using both the Formatter class and String.format. In both cases, it says it can't find the symbol format(Java.lang.String,Java.lang.String), or whatever might be appropriate for the arguments I've given it. Here's an example:
public String toRawString() {
return String.format("%10s", sku);
}
(where SKU is a string. And this method is oversimplified at the moment just til I get it working, will be adding more arguments in there)
I've tried copy-pasting examples from the web into new classes, and it gets the same error, so I think something's wrong with my IDE. Any ideas?
EDIT: I've found a kludgy workaround that might shed some light on the problem... The only parameter it will accept is an object array (Object[]), so this works:
public String toRawString() {
String[] bleh=new String[1];
bleh[0]=sku;
return String.format("%10s", bleh);
}
It doesn't give any more errors like that, and still compiles, but I shouldn't need to do that.