1. 删除workspace/.metadata目录下的.lock文件(此文件为隐藏文件)
cd ${你的workspace目录}/.metadata
rm .lock (我的可以直接删除,如果不行需要加上sudo 授权)
2. cd /Applications/Eclipse.app/Contents/MacOS/
3. ./eclipse -clean -refresh
4. 之后会出现如下
*********MacBook:MacOS ******$ ./eclipse -clean -refresh
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /Users/liusongshu/Documents/workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.7.0.20160603-1933.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://956.fwk832947102:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://956.fwk832947102:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
然后按住ctrl+z然后输入bg 1
^Z
[1]+ Stopped ./eclipse -clean -refresh
****MacBook:MacOS *****$ bg 1
[1]+ ./eclipse -clean -refresh &
ps. 如果你的Eclipse的配置文件eclipse.ini中没有配置-vm,需要在eclipse或者环境变量中指定JAVA_HOME,不然第三步会出现乱七八糟的问题