View Single Post
  #1 (permalink)  
Old 08-06-2007, 07:07 PM
cachi cachi is offline
Member
 
Join Date: Jul 2007
Posts: 40
cachi is on a distinguished road
Error: Cannot access protected member long getTimeInMillis() in class Calendar
Hi, I am coding a cross-platform piece of code, which explicitly needs to be backwards (and forwards) compatible, between various versions of Java.

However, another problem is that it also needs to be VM cross compatible (between Sun JVM 1.2+ and Microsoft JVM 6.0+).

The requirement is to compile using Microsoft JDK (jvc.exe) 6.00.8343.

I have a piece of code that looks something like this:
Code:
long time = Calendar.getInstance(TimeZone.get...).getTimeInMillis();
This works fine under Sun JDK (1.3.1), but under Microsoft, it spits out the following error:
Code:
java\xxx\yyy\Zzzzz.java(4129,57) : error J0203: Cannot access protected member 'long getTimeInMillis()' in class 'Calendar' from class 'Zzzzz.Zinner'
Where could I find the API specification document for the Microsoft JDK Calendar class; or what would be another way of achieving this (another method that's both public and common to both JDK perhaps)?
Thanks.
Reply With Quote
Sponsored Links