当前位置: 首页 > 知识库问答 >
问题:

无法打开Eclipse,因为ClassNotFoundException:WToolkitHookQTJA

公西俊民
2023-03-14

然后我会得到这样的错误消息:“一个错误已经发生。请参阅日志文件{日志文件的路径}”

当我检查日志文件时,我发现根本原因是找不到WToolkitHookQTJA类:

java.lang.NoClassDefFoundError: com/mercury/ftjadin/hooks/interfaces/WToolkitHookQTJA
at org.eclipse.swt.widgets.Shell.<init>(Shell.java:297)
at org.eclipse.swt.widgets.Shell.internal_new(Shell.java:419)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.ui.internal.WorkbenchPlugin.getSplashShell(WorkbenchPlugin.java:1360)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:114)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

原因:java.lang.ClassNotFoundException:org.eclipse.swt_3.103.1.v20140903-1938在org.eclipse.osgi.internal.loader.bundleLoader.findClassInternal(bundleLoader.java:432)在org.eclipse.osgi.internal.loader.bundleLoader.findClass(bundleLoader.java:345)在org.eclipse.osgi.internal.loader.bundleLoader.findClass(bundleLoader.java:337)在org.eclipse.osgi.internal.loader.bundleLoader.findClass(bundleLoader.findClass(.eclipse.osgi.internal.loader.ModuleClassLoader.LoadClass(ModuleClassLoader.java:160)位于java.lang.ClassLoader.LoadClass(ClassLoader.java:357)

我怀疑发生这种情况的原因是因为我的系统路径上有两个Java,最近我不得不让jdk8(它不在System32中)首先出现在系统路径中,以使其他东西正常工作。当我打开一个cmd并输入wherejava时,我会得到:

C:\Program Files\Java\jdk1.8.0_31\bin\java.exe
C:\Windows\System32\java.exe

因此,我的问题是:如何才能让eclipse重新打开,而不(a)将jdk8移到System32 java之后,以及(b)不重新安装eclipse?

共有1个答案

施冠玉
2023-03-14

尝试在eclipse.ini中指定JVM:

-vm
C:\Java\JDK\1.6\bin\javaw.exe

(如果我没记错的话,也可能在命令行中使用相同的语法)

 类似资料: