首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Eclipse在加载工作台时挂起

Eclipse在加载工作台时挂起
EN

Stack Overflow用户
提问于 2012-01-23 21:01:52
回答 22查看 106.9K关注 0票数 98

我的eclipse停止加载工作台。我已经尝试过从./eclipse --clean开始

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

代码语言:javascript
复制
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)

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

我的工作台怎么了?

EN

回答 22

Stack Overflow用户

回答已采纳

发布于 2012-10-23 08:22:46

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

  • Delete您的主目录中的.eclipse目录。启动eclipse。如果这不起作用,

  • 将在另一个用户帐户下打开eclipse。如果它加载,您就知道问题出在您的帐户上,而不是您的eclipse installation.

票数 146
EN

Stack Overflow用户

发布于 2013-05-10 21:43:57

http://off-topic.biz/en/eclipse-hangs-at-startup-showing-only-the-splash-screen/上展示的过程对我很有效:

.metadata/.plugins

  • mv org.eclipse.core.resources.bak

  • Start
  1. cd org.eclipse.core.resources eclipse。(它应该显示一条错误消息或一个空工作区,因为找不到任何项目。)
  2. 关闭所有打开的编辑器选项卡。
  3. 退出eclipse。
  4. rm -rf org.eclipse.core.resources (删除新创建的eclipse.eclipse.core.resources.bak/ org.eclipse.core.resources (恢复原始eclipse并开始工作。:-)

在其他答案中:

代码语言:javascript
复制
eclipse -clean -clearPersistedState

这似乎有相同甚至更好的效果。

这是一个用于MacOS (使用Macports)和Linux (使用eclipse Equinox在Ubuntu上测试)的脚本,它可以通过一个可选的终止正在运行的Eclipse来开始。您可能希望调整脚本以满足您的需要。如果您添加了新平台,请编辑此答案中的脚本。

代码语言:javascript
复制
#!/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&
票数 92
EN

Stack Overflow用户

发布于 2013-08-17 01:52:32

代码语言:javascript
复制
./eclipse -clean -refresh

正如sulai Dec 20 '12在12:46的评论中提到的,这对我很有效。

然而,在Mac上,我必须弄清楚如何访问./eclipse

以下是解决方案:

代码语言:javascript
复制
cd Eclipse.app/Contents/MacOS/

感谢安德鲁对这篇文章的评论:https://stackoverflow.com/a/1783448/2162226

票数 37
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8972034

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档