I had to discover I have Java code in my project, which compiles and runs fine in Eclipse, but throws a compilation error in javac.
A self-contained snippet:
It seems that Sun's 1.6 JDK can't infer the correct type. The following seems to work on my machine:
Set setOfObjects = Main.covariantSet(setOfInts);
Note that you must invoke the static method prefixed with the class name