Community
Participate
Working Groups
The code below (from http://jakarta.apache.org/commons/cli/usage.html) compiles with javac (tested 1.4.2 and IBM 1.3.0), but not with Eclipse. Eclipse error: The static method create(String) from the type OptionBuilder should be accessed in a static way OptionBuilderTest.java import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionBuilder; public class OptionBuilderTest { public static void main(String[] args) { Option logfile = OptionBuilder.withArgName( "file" ) .hasArg() .withDescription( "use given file for log" ) .create( "file" ); } }
Set Preferences>Java>Compiler>Style>Non-static access to static member>Warning or Ignore. Note that by default this was not an error. You must have enabled it manually in order to get this diagnosis.