java.util.Date -> NullPointerException
Gregory R. Warnes
warnes@biostat.washington.edu
Thu May 18 16:29:00 GMT 2000
I got this error even it I had an empty classpath.
BTW, I'm still getting a different, but related error.
On 2000年5月19日, Bryce McKinlay wrote:
BM>> OK, the existing code is definitely wrong here. I'm going to check in your
BM>> change.
BM>>
BM>> What is not clear is why the URLClassLoader is being used at all here. The
BM>> system classloader should find the compiled "gnu.gcj.text.LocaleData_en_US" in
BM>> libgcj.so, but it seems that if you explicitly put "libgcj.zip" on your
BM>> classpath (which you shouldn't), Class.forName() prefers the .class version,
BM>> and loads it that way. This is strange, because I thought it was designed to
BM>> prefer native classes if available. Perhaps the fact that this class is in a
BM>> .zip confuses this?
BM>>
BM>> Anyway, I strongly recommend not putting libgcj.zip in your CLASSPATH.
BM>>
BM>> regards
BM>>
BM>> [ bryce ]
BM>>
BM>> "Gregory R. Warnes" wrote:
BM>>
BM>> > --- libgcj/libjava/gnu/gcj/protocol/jar/Connection.java.orig Thu May 18
BM>> > 12:24:07 2000
BM>> > +++ libgcj/libjava/gnu/gcj/protocol/jar/Connection.java Thu May 18
BM>> > 12:23:25 2000
BM>> > @@ -59,7 +59,7 @@
BM>> > if (getUseCaches())
BM>> > {
BM>> > jarfile = (JarFile) file_cache.get(jarFileURL);
BM>> > - if (jarFileURL == null)
BM>> > + if (jarfile == null)
BM>> > {
BM>> > jarfile = new JarFile (jarFileURL.getFile ());
BM>> > file_cache.put (jarFileURL, jarfile);
BM>> >
BM>> > Making this change lets HelloDate work:
BM>> >
BM>> > hydra:/tmp> gcj -o HelloDate HelloDate.java --main=HelloDate
BM>> > hydra:/tmp> ./HelloDate
BM>> > Hello World, Today is Thu May 18 19:49:22 GMT 2000
BM>>
BM>>
More information about the Java
mailing list