2013-07-13 51 views
0

我在OS X Mountain Lion上安裝了e(fx)clipse插件。當我啓動Eclipse時,出現以下錯誤消息:OS X上的JAVA_HOME和e(fx)clipse

您沒有在Java7或Java8中運行eclipse實例。 JavaFX工具因此被禁用。 使Java7/8成爲默認系統java或調整您的eclipse.ini 以傳遞指向您的Java7/8安裝的-vm。 如果你想關閉這個檢查打開您的喜好 並進入常規>啓動和關閉,並取消 「的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) 

但仍然有同樣的錯誤MESSA GE。我也試圖改變我的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並試圖從外殼啓動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 [email protected]4702 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 

任何線索? Thx提前!

+0

echo $ JAVA_HOME給你什麼? – alex

+0

,給我'/圖書館/ Java/JavaVirtualMachines/jdk1.7.0_25.jdk /內容/主頁 – kinnla

回答

1

問題可能是os-x jdk 1.7.0_25-b15,eclipse Juno和e(fx)clipse插件之間的不兼容問題。 Kepler的升級解決了這個問題。