tags:

views:

1388

answers:

10

I'm trying to get started with Eclipse/Java/Scala on a MacBook. The installed JDK was 1.5. The SDT plugin for Scala requires 1.6 which was included in an OS update, but I also manually installed a package from Apple to update 1.6. The problem is that I cannot run anything from Eclipse. I always get the following error:

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

I also tried to use the old 1.5 version, but to no avail.

What is going wrong here?

A: 

The problem is:

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

A quick google search reveals that this class belongs to the IBM Globalization package ICU. http://www-01.ibm.com/software/globalization/icu/index.jsp

A guess would be that this is a package used internally by Scala that you have not installed properly, causing Scala startup to fail.

Thorbjørn Ravn Andersen
Even without installing Scala, the problem is still there. So, I don't think that's the reason. :-(
Andre
Interesting. In that case, please try creating a Hello World program. If this fails with the above error, then create a new workspace and create a Hello World program in that. If THAT fails too (which I don't think it will) then I think you need a fresh Eclipse distribution.
Thorbjørn Ravn Andersen
ICU is used by Eclipse, but java.util.TimeZone.getAvailableIDs() is throwing an exception. So it' is a Java problem.
Steven R. Loomis
A: 

Make sure that you set java 1.6 in the run configuration (Run/Run configurations).

Oleg Ryaboy
A: 

Did you upgrade to Snow Leopard? Are you using the Eclipse SWT/Carbon or the Eclipse SWT/Cocoa? I was seeing some strangeness with Eclipse after I upgraded to SL. Switching to the Eclipse SWT/Cocoa from Eclipse SWT/Carbon helped. Also restoring my 1.5 VM, which the SL install removes in a sneaky way(by deleting and leaving the symbolic link pointing to 1.6), helped me fix several issues with Java code that had natives(i.e. usb-serial port code).

James Branigan
A: 

I'm seeing the same error when trying install the Quantum DB browser plugin for Eclipse. I'm using Eclipse Galileo on an Intel based MacBook Pro. Should we be seeking out and installing this class: com.ibm.icu.impl.JavaTimeZone?

Riccardo
A: 

Check what are the JVMs that Eclipse is aware of and where they are located (Preferences -> Java -> Installed JRE), and also check the run/debug configuration of your programs. By default, Eclipse knows about the JRE that was used to launch itself, and other JREs that you add manually. However, if you upgrade some components and the JREs changed, Eclipse can get "confused" about them.

Yoni
A: 

I have tried all this but no use.. It still persists. Also any new eclipse plugins i install do not show up either.

Btw ths time zone issue is not just while running programs, when i open the error log the same error is thrown ; irony huh? Error log view Errors out.

I am running mac OSX 10.5.8 the dump is as below

java.lang.NoClassDefFoundError at com.ibm.icu.util.TimeZone.getDefault(TimeZone.java:804) at com.ibm.icu.util.Calendar.getInstanceInternal(Calendar.java:1630) at com.ibm.icu.util.Calendar.getInstance(Calendar.java:1594) at com.ibm.icu.text.SimpleDateFormat.initialize(SimpleDateFormat.java:465) at com.ibm.icu.text.SimpleDateFormat.(SimpleDateFormat.java:435) at com.ibm.icu.text.SimpleDateFormat.(SimpleDateFormat.java:368) at org.eclipse.ui.internal.views.log.LogSession.setDate(LogSession.java:43) at org.eclipse.ui.internal.views.log.LogSession.processLogLine(LogSession.java:67) at org.eclipse.ui.internal.views.log.LogReader.parseLogFile(LogReader.java:90) at org.eclipse.ui.internal.views.log.LogView.readLogFile(LogView.java:812) at org.eclipse.ui.internal.views.log.LogView.createPartControl(LogView.java:172) at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:367) at org.eclipse.ui.in

Mrajah
A: 

I had this same issue with Eclipse on Windows. I tried a number of different things including a new hello world program in a new workspace. I finally got this to work by pointing Eclipse to a different JRE to execute with. I know that Apple provides the JRE for Mac, but it does seem like this issue is related to Eclipse having trouble with the JRE used to run Eclipse itself. See here for configuring which VM Eclipse executes with.

nondescript1
+1  A: 

I had the same problem trying to run a scala program with Ubuntu 10.4 and stock eclipse (Galileo 3.5.2) and java (java-6-openJdk ) - and the scala pluging downloaded from scala site, of course. I fixed it by manually changing /usr/lib/eclipse/plugins/com.ibm.icu_4.0.1.v20100125.jar as suggested in this thread (btw I discovered that Emacs can change a jar file in place: nice):

http://www.eclipse.org/forums/index.php?t=msg&goto=488654

I have no idea why it works, but it works :-)

F.B
A: 

Did anyone fix this??? I thought changing vm argument value to Java 1.5 would fix this.. but it didn't. Weird!!

narup
I put a note on your question at http://stackoverflow.com/questions/2828533 with an edit to eclipse.ini that is a better workaround than modifying the .jar
Steven R. Loomis
A: 

I posted a question about this at a newer thread, http://stackoverflow.com/questions/2828533

Steven R. Loomis