0

我在 OS X Mountain Lion 上安装了 e(fx)clipse 插件。当我启动 Eclipse 时,我收到以下错误消息:

您没有使用 Java7 或 Java8 运行 Eclipse 实例。JavaFX 工具因此被禁用。将 Java7/8 设为默认系统 java 或调整 eclipse.ini 以传递 -vm 指向您的 Java7/8 安装。如果您想关闭此检查,请打开您的首选项并转到常规 > 启动和关闭并取消选中“JavaFX 工具 Java 检查”

所以我检查了 JAVA_HOME 并将以下行添加到我的.profile

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home

我的java现在是:

Kinnlas-MacBook:libexec kinnla$ java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

但仍然有相同的错误信息。我也尝试修改我的eclipse.ini

-vm
/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java

这给了我另一个错误消息:

JVM 共享库“/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk”不包含 JNI_CreateJavaVM 符号。

所以我回到原来的状态eclipse.ini并尝试从 shell 启动 eclipse:

java -jar /Applications/eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar

启动失败,错误日志如下:

!SESSION 2013-07-20 14:42:49.845 -----------------------------------------------
eclipse.buildId=M20130204-1200
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US

!ENTRY org.eclipse.equinox.ds 4 0 2013-07-20 14:42:52.305
!MESSAGE [SCR] Exception while activating instance org.eclipse.e4.ui.css.swt.internal.theme.ThemeEngineManager@5b094702 of component org.eclipse.e4.ui.css.swt.theme  
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Display
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
    at java.lang.Class.getDeclaredMethods(Class.java:1845)
    at org.eclipse.equinox.internal.ds.model.ServiceComponent.getMethod(ServiceComponent.java:126)
    at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:213)
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
    at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)
    at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)
    at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)
    at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)
    at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
    at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Display
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 15 more

有什么线索吗?提前谢谢!

4

1 回答 1

1

问题可能是 os-x jdk 1.7.0_25-b15、eclipse Juno 和 e(fx)clipse 插件之间不兼容。Eclipse Kepler 的升级解决了这个问题。

于 2013-07-20T14:25:56.347 回答