Eclipse NoClassDefFoundError near installFont on startup

At work and at home I use Eclipse as my IDE of choice for Java development, along with Eclipse-in-disguise Aptana for web development. I’ve never had a problem with Eclipse on Windows or on my Mac, but on my Linux machine (and many of my co-workers’ machines) Eclipse tends to crash rather violently. I suspect that it isn’t Eclipse at all, but the primitive P4WSAD Perforce plugin. I don’t use Perforce at home, so that might be the difference. Anyway, what happens is that in the middle of doing something Eclipse will run out of PermGen memory, throw up some errors, and die in the least pleasant way possible. When you try to start it back up, you get something like this:

 !SUBENTRY 1 4 0 2007-08-20 16:58:25.979
 !MESSAGE Could not instantiate provider for project SampleProject.
 Exception in thread "Thread-1" java.lang.NoClassDefFoundError
         at org.eclipse.ui.internal.themes.ThemeElementHelper.installFont(
         at org.eclipse.ui.internal.themes.ThemeElementHelper.populateRegistry(
         at org.eclipse.ui.internal.Workbench$28.runWithException(
         at org.eclipse.ui.internal.StartupThreading$
         at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
         at org.eclipse.swt.widgets.Display.runAsyncMessages(
         at org.eclipse.swt.widgets.Display.readAndDispatch(
         at org.eclipse.ui.internal.Workbench.runUI(
         at org.eclipse.ui.internal.Workbench.access$4(
         at org.eclipse.ui.internal.Workbench$
         at org.eclipse.core.databinding.observable.Realm.runWithDefault(
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
         at org.eclipse.ui.internal.ide.application.IDEApplication.start(
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
         at java.lang.reflect.Method.invoke(
         at org.eclipse.equinox.launcher.Main.invokeFramework(
         at org.eclipse.equinox.launcher.Main.basicRun(

Further digging reveals that the culprit is definitely the Perforce plugin. To fix it, you need to go to where Eclipse is installed, and move the plugins/com.perforce.* files away. Then start Eclipse, which will start but complain about the missing plugin. Then shut down Eclipse, move the plugins back, and start up again. You’ll need to reconfigure any Perforce windows you had open, but at least Eclipse will start.

This seems to be caused by Eclipse crashing after running out of PermGen memory. To prevent future crashes, edit eclipse.ini in your Eclipse install directory. It should look something like this:


The -XX:MaxPermSize is especially important for preventing Eclipse crashes. The other option, –launcher.XXMaxPermSize only works in Windows.

I'm Benjamin Hollis, a software developer in Seattle. Check out my website.