Eclipse hangs on loading workbench

后端 未结 22 1203
滥情空心
滥情空心 2020-12-04 05:43

My eclipse stops loading workbench. I tried already starting with ./eclipse --clean

When starting from console it throws following exception:

java.lang         


        
相关标签:
22条回答
  • 2020-12-04 06:12

    After some investigation about file dates I solved the same issue (which is a randomly recurrent trouble on my Kepler) by simply deleting the following file in my local workspace: .metadata.plugins\org.eclipse.jdt.core\variablesAndContainers.dat

    with negligible impact on the workspace restoring.

    I hope it can help someone else...

    0 讨论(0)
  • 2020-12-04 06:15

    Eclipse freezing at startup - before loading workspace very good answer on this post. repeating the answer that worked for me

    In your workspace directory perform the following steps:

    cd .metadata/.plugins

    mv org.eclipse.core.resources org.eclipse.core.resources.bak

    Start eclipse. (It should show an error message or an empty workspace because no project is found.)

    Close all open editors tabs.

    Exit eclipse.

    rm -rf org.eclipse.core.resources (Delete the newly created directory.)

    mv org.eclipse.core.resources.bak/ org.eclipse.core.resources (Restore the original directory.)

    Start eclipse and start working. :-)

    Answer by CharlesB

    0 讨论(0)
  • 2020-12-04 06:16

    The procedure shown at http://off-topic.biz/en/eclipse-hangs-at-startup-showing-only-the-splash-screen/ worked for me:

    1. cd .metadata/.plugins
    2. mv org.eclipse.core.resources org.eclipse.core.resources.bak
    3. Start eclipse. (It should show an error message or an empty workspace because no project is found.)
    4. Close all open editors tabs.
    5. Exit eclipse.
    6. rm -rf org.eclipse.core.resources (Delete the newly created directory.)
    7. mv org.eclipse.core.resources.bak/ org.eclipse.core.resources (Restore the original directory.)
    8. Start eclipse and start working. :-)

    In other answers:

    eclipse -clean -clearPersistedState
    

    is mentioned - which seems to have the same or even better effect.

    Here is a script for MacOS (using Macports) and Linux (tested on Ubuntu with Eclipse Equinox) to do the start with an an optional kill of the running eclipse. You might want to adapt the script to your needs. If you add new platforms please edit the script right in this answer.

    #!/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&
    
    0 讨论(0)
  • 2020-12-04 06:16

    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.

    0 讨论(0)
提交回复
热议问题