第一次在mac上安装eclipse,并配置java环境,一切都摸索着来,看了好多帖子,最开始说mac上自带了java环境,安装eclipse可以直接使用了,结果在官网上下载后,提示安装jdk,自动跳转至苹果推荐的1.6版本,并不能解决问题,遂到Oracle官网下载最新jdk,满心欢喜安装好后,还是提示了新的错误(an error has occurred see the log file)。
!SESSION 2011-12-07 01:27:30.742 -----------------------------------------------eclipse.buildId=M20110909-1335java.version=1.6.0_29java.vendor=Apple Inc.BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_USFramework arguments: -product org.eclipse.epp.package.java.product -keyring /Users/Julien/.eclipse_keyring -showlocationCommand-line arguments: -os macosx -ws cocoa -arch x86 -product org.eclipse.epp.package.java.product -keyring /Users/Julien/.eclipse_keyring -showlocation!ENTRY org.eclipse.equinox.p2.core 4 0 2011-12-07 01:27:31.721!MESSAGE Provisioning exception!STACK 1org.eclipse.equinox.p2.core.ProvisionException: Unknown repository type at file:/Applications/eclipse/configuration/org.eclipse.osgi/bundles/126/data/listener_1925729951/. at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail(AbstractRepositoryManager.java:393) at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.doCreateRepository(AbstractRepositoryManager.java:282) at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.createRepository(MetadataRepositoryManager.java:41) at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.initializeMetadataRepository(RepositoryListener.java:109) at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.(RepositoryListener.java:59) at org.eclipse.equinox.internal.p2.reconciler.dropins.DropinsRepositoryListener.(DropinsRepositoryListener.java:82) at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.watchDropins(Activator.java:532) at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start(Activator.java:172) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457) at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)!SUBENTRY 1 org.eclipse.equinox.p2.metadata.repository 4 1005 2011-12-07 01:27:31.722!MESSAGE Unknown repository type at file:/Applications/eclipse/configuration/org.eclipse.osgi/bundles/126/data/listener_1925729951/.!ENTRY org.eclipse.equinox.p2.reconciler.dropins 4 0 2011-12-07 01:27:31.725!MESSAGE FrameworkEvent ERROR!STACK 0org.osgi.framework.BundleException: Exception in org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start() of bundle org.eclipse.equinox.p2.reconciler.dropins. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457) at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)Caused by: java.lang.IllegalStateException: Could not create metadata repository for: file:/Applications/eclipse/configuration/org.eclipse.osgi/bundles/126/data/listener_1925729951/ at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.initializeMetadataRepository(RepositoryListener.java:112) at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.(RepositoryListener.java:59) at org.eclipse.equinox.internal.p2.reconciler.dropins.DropinsRepositoryListener.(DropinsRepositoryListener.java:82) at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.watchDropins(Activator.java:532) at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start(Activator.java:172) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702) ... 12 moreRoot exception:java.lang.IllegalStateException: Could not create metadata repository for: file:/Applications/eclipse/configuration/org.eclipse.osgi/bundles/126/data/listener_1925729951/ at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.initializeMetadataRepository(RepositoryListener.java:112) at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.(RepositoryListener.java:59) at org.eclipse.equinox.internal.p2.reconciler.dropins.DropinsRepositoryListener.(DropinsRepositoryListener.java:82) at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.watchDropins(Activator.java:532) at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start(Activator.java:172) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457) at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)!ENTRY org.eclipse.osgi 4 0 2011-12-07 01:27:31.810!MESSAGE Application error!STACK 1org.osgi.service.application.ApplicationException: No application id has been found. at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:262) at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
几乎尝试了帖子里所有的方法:
1⃣️eclipse -clean
2⃣️删除 .metadata目录下.plugins/org.eclipse.e4.workbench,使用此方法需要显示隐藏文件显示Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool true
隐藏Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool false
需要重启finder,鼠标单击窗口左上角的苹果标志-->强制退出-->Finder-->重新启动
3⃣️删除eclipse-workspace/.metadata/.plugins里面文件,然后重新指定位置的
忙活了一天也没有解决什么问题。最后就想着用最原始的方法,删除最新jdk,换回jdk1.8。查看了java提供的官方文档,删除jdk:
导航到/Library/Java/JavaVirtualMachines并删除该目录下需要删除的jdk,由于mac上删除环境需要管理员权限。可用一下命令:
sudo rm -rf jdk名称
然后下载安装jdk1.8,运行eclipse,大功告成。。