简体   繁体   中英

NullPointerException with openjdk 6 on Ubuntu 12.04

I recently upgraded to ubuntu 12.04 from 10.10. Since then, I get a NullPointerException in the TimeZone class with openjdk 6.

TimeZone.getTimeZone("GMT-0:00");

There is no exception with openjdk 7, nor do my coworkers get an exception with openjdk6. So it looks like I'm missing some necessary library.

Also, this works just fine: TimeZone.getTimeZone("GMT") on my machine with openjdk 6

I was able to solve it by complete removing the tzdata-java package and re-installing. Note that also removed a bunch of openjdk6 packages as well. (I had already tried completely removing and reinstalling the openjdk6 packages without luck).

I had a similar issue with DbVisualizer yesterday (NPE on startup), and it turned out that a forum post at http://www.dbvis.com/forum/thread.jspa?messageID=14474 had the solution.

Try running this command to see where your Java timezone files are located:

locate GMT | grep java | grep zi

In my case, the contents of /usr/share/javazi were symlinks that pointed to the actual files, and many of those symlinks were broken. I simply re-pointed the symlinks for my timezone to the new file locations, and that got DbViz working for me. Perhaps something similar will work for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM