tags:

views:

293

answers:

1

I am having a serious pain trying to run eclipse in mac os x 10.5.8. I tried every version carbon, cocoa, 32, 64 bit but nothing works i keep getting

java.lang.NoClassDefFoundError`

... or ...

An internal error occurred during: "Launching TestFooBasicTest". Could not initialize class com.ibm.icu.impl.JavaTimeZone error.

... when I try to run the main class.

I know there's another thread in stack overflow but there's no proper answer if someone fixed it.

Please let me know if someone fixed it

+1  A: 

ICU developer here. Can you save this code as 'tztest.java' and then run "javac tztest.java ; java tztest"

public class tztest {
    public static void main(String args[]) {
        String[] availableIds = java.util.TimeZone.getAvailableIDs();
        System.out.println("Length: "+availableIds.length);
        for (int i = 0; i < availableIds.length; i++) {
            System.out.println("ID #"+i+": "+availableIds[i]);
        }
    }
}

Don't paste the whole output (may be several hundred lines).. but are there any NULL strings?

Steven R. Loomis
I got this exception, for some reason availableIds is coming as null.Exception in thread "main" java.lang.NullPointerException at sun.util.calendar.ZoneInfoFile.getZoneIDs(ZoneInfoFile.java:729) at sun.util.calendar.ZoneInfo.getAvailableIDs(ZoneInfo.java:517) at java.util.TimeZone.getAvailableIDs(TimeZone.java:497) at com.yahoo.labs.TzTest.main(TzTest.java:10)
narup
Hmm.. http://bugs.sun.com/view_bug.do?bug_id=6529213Can you look for the file ZoneInfoMappings ?find /System/Library /Library -name ZoneInfoMappings -ls
Steven R. Loomis
Hi Steve, It doesn't find that class!!
narup
You should have the file somewhere on your disk.. like /System/Library/Frameworks/JavaVM.framework/Versions/###/Home/lib/zi/ZoneInfoMappings ( where ### is some version ) .. it might be in /System/Library/PrivateFrameworks otherwise .
Steven R. Loomis
Did you ever run a 'time zone updater'? Can you do "java -version" to see which java is being used? If you run java (not javac) with sudo, does it work? (sudo java tztest)
Steven R. Loomis
java version "1.6.0_17"Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-9M3125)Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)i haven't run time zone updater. Also even if i run with sudo i get the same null pointer because of null availableIds
narup
ok.. i will try that, lets see but it didn't work for me yesterday. i will give another shot. Thanks
narup
Actually, even better is NOT to edit the jar at all, but to edit eclipse.ini to add a line at the end (one line, remove the quotes!) "-Dcom.ibm.icu.util.TimeZone.DefaultTimeZoneType=ICU"It's inside Eclipse.app/Contents/MacOS/eclipse.iniMy colleague points out that editing the jar makes it unsigned.see:http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/running_eclipse.htm
Steven R. Loomis