Eclipse挂起加载工作台

end*_*ian 95 eclipse macos osx-snow-leopard

我的eclipse停止加载工作台.我试过已经开始使用./eclipse --clean了

从控制台启动时,它会抛出以下异常:

java.lang.NullPointerException
    at org.eclipse.core.internal.runtime.Log.isLoggable(Log.java:101)
    at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.safeIsLoggable(ExtendedLogReaderServiceFactory.java:57)
    at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.logPrivileged(ExtendedLogReaderServiceFactory.java:158)
    at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.log(ExtendedLogReaderServiceFactory.java:146)
    at org.eclipse.equinox.log.internal.ExtendedLogServiceFactory.log(ExtendedLogServiceFactory.java:65)
    at org.eclipse.equinox.log.internal.ExtendedLogServiceImpl.log(ExtendedLogServiceImpl.java:87)
    at org.eclipse.equinox.log.internal.LoggerImpl.log(LoggerImpl.java:54)
    at org.eclipse.core.internal.runtime.Log.log(Log.java:60)
    at org.tigris.subversion.clientadapter.javahl.Activator.isAvailable(Activator.java:92)
    at org.tigris.subversion.clientadapter.Activator.getAnyClientAdapter(Activator.java:81)
    at org.tigris.subversion.subclipse.core.SVNClientManager.getAdapter(SVNClientManager.java:145)
    at org.tigris.subversion.subclipse.core.SVNClientManager.getSVNClient(SVNClientManager.java:92)
    at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getSVNClient(SVNProviderPlugin.java:425)
    at org.tigris.subversion.subclipse.core.status.NonRecursiveStatusUpdateStrategy.statusesToUpdate(NonRecursiveStatusUpdateStrategy.java:53)
    at org.tigris.subversion.subclipse.core.status.StatusCacheManager.refreshStatus(StatusCacheManager.java:273)
    at org.tigris.subversion.subclipse.core.resourcesListeners.FileModificationManager.refreshStatus(FileModificationManager.java:179)
    at org.tigris.subversion.subclipse.core.resourcesListeners.FileModificationManager.resourceChanged(FileModificationManager.java:128)
    at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
    at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
    at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395)
    at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Run Code Online (Sandbox Code Playgroud)

它在加载com.android.ide.eclipse.adt时停止

我的工作台有什么问题?

Eclipse启动屏幕

小智 146

DISCLAIMER: THIS WILL DELETE ALL OF YOUR ECLIPSE WORKSPACE SETTINGS AND YOU WILL HAVE TO RE-IMPORT ALL YOUR PROJECTS, THERE ARE LESS DESTRUCTIVE ANSWERS HERE

请尝试以下方法:

  1. 删除本地工作区中.metadata文件夹(这对我有用).它似乎包含一个.LOCK文件,如果没有正确关闭,可以防止eclipse正常启动.在基于Unix的系统上,您可以在命令行上键入以下内容;

    rm -r workspace/.metadata
    
    Run Code Online (Sandbox Code Playgroud)
  2. 删除目录中的.eclipse目录.发射日食.如果这不起作用,

  3. 在另一个用户帐户下打开eclipse.如果它加载,你知道问题在于你的帐户,而不是你的eclipse安装.

  • 在大多数情况下,`rm workspace/.metadata/.lock`对我有用.无论你尝试什么,一定要使用`.eclipse -clean -refresh`启动eclipse.感谢教我们`mv .eclipse .eclipse.old`,这在今天没有用.今天它有助于删除`workspace/.metadata/.plugins /`.所有插件实际上都在那之后工作.一些设置不见了.然后,您可以使用`Import ...`一次导入所有现有项目.删除`workspace/.metadata`是最后的选择,但有效.如果您不想丢失任务,可以保留`workspace/.metadata/.mylyn`. (68认同)
  • 删除.lock对我没有帮助,但删除`.metadata/.plugins/org.eclipse.core.resources/.snap` (7认同)
  • 只需删除.lock文件 - 无需丢失所有设置! (3认同)

Wol*_*ahl 91

http://off-topic.biz/en/eclipse-hangs-at-startup-showing-only-the-splash-screen/上显示的程序 为我工作:

  1. cd .metadata/.plugins
  2. mv org.eclipse.core.resources org.eclipse.core.resources.bak
  3. 开始日食.(它应该显示错误消息或空工作区,因为找不到项目.)
  4. 关闭所有打开的编辑器选项卡.
  5. 退出日食.
  6. rm -rf org.eclipse.core.resources(删除新创建的目录.)
  7. mv org.eclipse.core.resources.bak/org.eclipse.core.resources(恢复原始目录.)
  8. 启动eclipse并开始工作.:-)

在其他答案:

eclipse -clean -clearPersistedState
Run Code Online (Sandbox Code Playgroud)

提到 - 似乎有相同甚至更好的效果.

下面是MacOS(使用Macports)和Linux(在Ubuntu上使用Eclipse Equinox测试)的脚本,可以选择杀死正在运行的eclipse.您可能希望根据需要调整脚本.如果您添加新平台,请在此答案中编辑脚本.

#!/bin/bash
# WF 2014-03-14
#
# ceclipse:
#   start Eclipse cleanly
#
#   this script calls eclipse with -clean and -clearPersistedState
#   if an instance of eclipse is already running the user is asked
#   if it should be killed first and if answered yes the process will be killed
#
# usage: ceclipse
#

#
# error
#
#   show an error message and exit
#
#   params:
#     1: l_msg - the message to display
error() {
  local l_msg="$1"
  echo "error: $l_msg" 1>&2
  exit 1 
}

#
# autoinstall
#
#  check that l_prog is available by calling which
#  if not available install from given package depending on Operating system
#
#  params: 
#    1: l_prog: The program that shall be checked
#    2: l_linuxpackage: The apt-package to install from
#    3: l_macospackage: The MacPorts package to install from
#
autoinstall() {
  local l_prog=$1
  local l_linuxpackage=$2
  local l_macospackage=$3
  echo "checking that $l_prog  is installed on os $os ..."
  which $l_prog 
  if [ $? -eq 1 ]
  then
    case $os in 
      # Mac OS
      Darwin) 
        echo "installing $l_prog from MacPorts package $l_macospackage"        
        sudo port install $l_macospackage
      ;;
      # e.g. Ubuntu/Fedora/Debian/Suse
      Linux)
        echo "installing $l_prog from apt-package $l_linuxpackage"        
        sudo apt-get install $l_linuxpackage
      ;;
      # git bash (Windows)
      MINGW32_NT-6.1)
        error "$l_prog ist not installed"
      ;;
      *)
        error "unknown operating system $os" 
    esac
  fi
}

# global operating system variable
os=`uname`

# first set 
#  eclipse_proc - the name of the eclipse process to look for
#  eclipse_app - the name of the eclipse application to start
case $os in 
    # Mac OS
    Darwin) 
      eclipse_proc="Eclipse.app" 
      eclipse_app="/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse"
      ;;
    # e.g. Ubuntu/Fedora/Debian/Suse
    Linux)
      eclipse_proc="/usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar"
      eclipse_app=`which eclipse`
      ;;
    # git bash (Windows)
    MINGW32_NT-6.1)
      eclipse_app=`which eclipse`
      error "$os not implemented yet"
      ;;
    *)
      error "unknown operating system $os" 
esac

# check that pgrep is installed or install it
autoinstall pgrep procps

# check whether eclipse process is running
# first check that we only find one process
echo "looking for $eclipse_proc process"
pgrep -fl "$eclipse_proc"
# can't use -c option on MacOS - use platform independent approach 
#eclipse_count=`pgrep -cfl "$eclipse_proc"`
eclipse_count=`pgrep -fl "$eclipse_proc" | wc -l | tr -d ' '`

# check how many processes matched
case $eclipse_count in
  # no eclipse - do nothing
  0) ;;
  # exactly one - offer to kill it
  1) 
     echo "Eclipse is running - shall i kill and restart it with -clean? y/n?"
       read answer
       case $answer in
         y|Y) ;;
           *) error "aborted ..." ;;
       esac
     echo "killing current $eclipse_proc"
     pkill -f "$eclipse_proc"
     ;;
  # multiple - this is bogus
  *) error "$eclipse_count processes matching $eclipse_proc found - please adapt $0";;
esac

tmp=/tmp/eclipse$$
echo "starting eclipse cleanly ... using $tmp for nohup.out"
mkdir -p $tmp
cd $tmp

# start eclipse with clean options
nohup $eclipse_app -clean -clearPersistedState&
Run Code Online (Sandbox Code Playgroud)

  • 这个"eclipse -clean -clearPersistedState"对我有所帮助,谢谢! (5认同)
  • -clean -clearPersistedState在胜利7的Aptana Studio 3为我工作 (2认同)
  • eclipse -clean -clearPersistedState在Kepler Win 7中工作 (2认同)

Gen*_* Bo 37

./eclipse -clean -refresh
Run Code Online (Sandbox Code Playgroud)

正如sulai 12月20日12:46在评论中提到的,这对我有用.

但是,在Mac OS X上,我必须弄清楚如何进入./eclipse

这是解决方案:

cd Eclipse.app/Contents/MacOS/
Run Code Online (Sandbox Code Playgroud)

谢谢Andrew对此帖的评论:https://stackoverflow.com/a/1783448/2162226

  • 那个命令对我也有用.谢谢 :) (2认同)
  • 我必须首先使用-clean -refresh打开一个新工作区(我将其命名为test).当Eclipse(在我的情况下是GGTS)打开时,我选择了File> Switch Workspace并返回到最初导致冻结问题的工作区. (2认同)

小智 19

我找到的最佳解决方案是删除此文件:workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench

  • 在日食靛蓝.试试rm workspace/.metadata/.plugins/org.eclipse.ui.workbench / (2认同)

use*_*102 12

无需删除整个元数据.只需尝试删除工作区文件夹ex中的org.eclipse.core.resources下的.snap文件.

workspaceFolder.metadata.plugins\org.eclipse.core.resources


luj*_*jop 11

我解决了从工作区目录(和所有子目录)删除*.snap:

元数据位于\ .plugins\*.卡扣


sbe*_*zin 8

相当古老的问题,但最简单的答案还没有发布.
这是:
1)[workspace]\.metadata\.plugins\org.eclipse.e4.workbench 删除 workbench.xmi文件中.
在大多数情况下,它足够了 - 尝试加载Eclipse.
仍然需要重新配置您的特定透视设置(如果有)

2)现在遇到构建完美工程的问题?根据我的经验,以下步骤可以帮助:
- 取消选中Projects-> Build
- 切换到Java透视图(如果还没有):Window - > Open perspective - > Java
- locate Problems view or open it:Window - > Show view - > Problems
- 右键单击​​问题组,然后选择" 删除".确保删除Lint错误
- 清理工作区:项目 - >清理...使用选项清除所有项目
- 检查项目 - >自动构建
- 如果某些项目仍然存在问题:右键单击项目,选择属性 - > Android并确保选择适当的项目构建目标

3)这对我来说总是足够的.但如果你仍然遇到问题 - 请尝试@george发布建议


小智 6

Following procedure worked on my MacOS (Mavericks) and Eclipse Luna 4.4.1:

Delete .snap file under the path "workspaceFolder".metadata.plugins\org.eclipse.core.resources\

If you don't know how to navigate to this folder on Mac, press Cmd + Shift + G (Go to the folder) and type the full address you want to navigate for.