Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

setTimeInMillis()'s access protection

28 views
Skip to first unread message

P.Michael Hutchins

unread,
May 12, 2006, 12:31:43 PM5/12/06
to

What do I have to do to convince JBuilder (2006 12.0.203.0) to stop giving me the error message "setTimeInMillis(long) has protected access in java.util.Calendar"?

I've got it set to java 5, as best I can.
(:o Paths / JDK: 1.5.0_03-b07
o Build Java:
o Language Features: v 5.0 (generics enabled)
o Target VM: 5.0 & later
)

Shankar Unni

unread,
May 12, 2006, 3:48:50 PM5/12/06
to
P.Michael Hutchins wrote:

Apparently not quite. Calendar.setTimeInMillis(long) was protected in
1.1, but has been public since 1.2.

Can you double-check your settings? (TeamB: are there hidden preferences
panels that might override the obvious setting of language source and
target levels?)

Gillmer J. Derge [TeamB]

unread,
May 12, 2006, 4:16:14 PM5/12/06
to
Shankar Unni wrote:
> Can you double-check your settings? (TeamB: are there hidden preferences
> panels that might override the obvious setting of language source and
> target levels?)

I don't think so, but this kind of error often happens when the
classpath contains a reference to a JAR file that contains old versions
of JDK classes. For example, your application refers to
"JacksUtilityPack.jar", and Jack has decided for some reason that he
needs to include java.util.Calendar in his library.

The suggestion I usually make when this happens is to write a small test
program that contains something like the following.

public class Foo {
public static void main(String[] args) {
System.out.println("found at " +
Foo.class.getResource("java/util/Calendar.class"));
}
}

This will print a URL that shows where the application is finding
java.util.Calendar. Presumably that will be an old version of the
class, and you'll need to figure out how to get that off the classpath.

--
Gillmer J. Derge [TeamB]

P.Michael Hutchins

unread,
May 15, 2006, 3:37:08 PM5/15/06
to

You are some dude, Gilmer!
(& tnx too to Shankar)

I took the mindless bulldog route, & did a binary search over my Required Libraries
(prompted by finding that a colleague using JBuilder wasn't having the same problem - & then that another Project of mine wasn't)
(not aided by the way JBuilder works, but...)
until I found the offender.

(: XmlBlaster thought it would be useful, for some reason to silently include a JAR file full of old "containers" - including Calendar.)

very confusing state of affairs!

a coupla things that JBuilder could do to help this situation:

o If it's gonna use an ... ancient supercession ... like this for its ~code insight~ and compilation, then when one does a Find Definition, it oughta take one *there* (instead - maximally confusingly - to the superseded (current official) class.

o ways to find out what JAR file(s) contain a given class


Thanks a BUNCH!

-- M.

0 new messages