Can't find method `setDSTSavings(I)' in type `java.util.SimpleTimeZone'.

Martin Egholm Nielsen martin@egholm-nielsen.dk
Tue Jun 1 09:41:00 GMT 2004


Hi there,

I'm trying to compile my project with gcj, and I've suddenly run into a 
weird problem. Consider the simplified sourcecode given here:

public class DSTTest
{
   public static void main(String[] args)
   {
     java.util.SimpleTimeZone stz = new java.util.SimpleTimeZone( 0, 
"MyGMT" );
     int dtsInMillis = 1*60*60*1000;
     stz.setDSTSavings( dtsInMillis );
   } // main
} // DSTTest

Compiling with gcj (both 3.3.1 and 3.4.0) results in the following error:

DSTTest.java: In class `DSTTest':
DSTTest.java: In method `DSTTest.main(java.lang.String[])':
DSTTest.java:7: error: Can't find method `setDSTSavings(I)' in type 
java.util.SimpleTimeZone'.
                 stz.setDSTSavings( dtsInMillis );
                       ^
1 error

However, if I look into the SimpleTimeZone class in libgcj.jar, I can 
see that it's actually there:

$ javap -classpath /usr/share/java/libgcj-3.3.1.jar 
java.util.SimpleTimeZone | grep setDST
     public void setDSTSavings(int);

Can anybody tell me what's wrong?

Best regards,
  Martin Egholm




More information about the Java mailing list