39

I downloaded Eclipse on my Mac for school, following these instructions:

In your browser, go to Eclipse Downloads. Do not use the Eclipse Installer. Instead follow these steps to download and install Eclipse.

Find the Eclipse IDE for Java Developers package (make sure you do not pick the wrong package) and click on the appropriate download link for your operating system (Windows, Mac, or Linux) and architecture (32-bit or 64-bit). There are many other packages but this is the one that you'll need in this class.

Once the download has completed, locate the downloaded file. This file will be a compressed (i.e., a ".zip", or ".tar.gz") file. Uncompress this file into the directory of your choice. It doesn't really matter where you put the Eclipse installation folder as long as you know how to retrieve it. You can optionally create a shortcut of the Eclipse IDE executable file ("eclipse.exe" on Windows, or "eclipse" on Linux, or "Eclipse" on Mac OS X) found in the directory that is created. To start Eclipse you just double-click on the executable file or the shortcut

I downloaded the Eclipse macOS x86_64 version, and moved it into my applications folder. I was able to open Eclipse, and everything works perfectly, and I can work if it's open; but after I close Eclipse and a couple hours go by, I get the following messages once I try to reopen it. "Eclipse quit unexpectedly" and "The application “Eclipse” can’t be opened."

I had the .dmg file in my downloads folder, which might have been the problem. I moved it into my applications folder with Eclipse, and that still doesn't work.

I have tried to delete and redownload Eclipse multiple times, and nothing works.

do you have any suggestions on how I can fix this?

sadnapoleon
  • 536
  • 1
  • 4
  • 13
  • Did you move the .dmg file to the application folder before or after you tried to run Eclipse? Is there more information when you run Eclipse from the command line? – howlger Jan 15 '22 at 23:13
  • You're not running it out of the .dmg itself, are you? – nitind Jan 16 '22 at 06:04
  • I would guess so. I'm not a macOS user/expert and only know that a .dmg file is mounted into the file system, but if the configuration area of Eclipse is inside the .dmg file, then it will be initialized on the first start-up and since it contains absolute paths mounting to a different location (which I guess is the case when moving the .dmg file) would not work (I know that for sure for Windows and Linux, but for a .dmg file on macOS I only guess). – howlger Jan 16 '22 at 13:52
  • Would my 'workspace' folder also have to be in applications? It's currently is in Documents. – sadnapoleon Jan 16 '22 at 18:47
  • Having the workspace in _Documents_ sounds good to me (I would guess this is also the default). – howlger Jan 17 '22 at 07:59
  • 1
    short term solution: don't close Eclipse – sadnapoleon Jan 17 '22 at 17:31
  • 1
    This is happening for me on Monterey on Intel mac. I've installed eclipse-ide from homebrew and it worked, before I first closed it. It's definitely not related to running eclipse from dmg itself. This is most likely a bug in eclipse and should be reported. – Garret Raziel Feb 07 '22 at 21:24
  • 1
    I saw this in Reddit instead of reinstalling you can use this as a temporary solution. codesign --force --deep --sign - /Applications/eclipse.app [https://www.reddit.com/r/eclipse/comments/s4t79o/eclipse_doesnt_start_after_osx_monterey_121/] – Oguz Mar 04 '22 at 08:27
  • The bug is described at https://bugs.eclipse.org/bugs/show_bug.cgi?id=578883 but there are no useful updates there as of the time of this comment. – lmsurprenant Jul 11 '22 at 16:59

9 Answers9

126

Faced the same issue each time I'm restarting the Macbook pro M1, and a random Reddit thread provided me with a way to fix it. Open a terminal and run,

sudo codesign --force --deep --sign - /Applications/Eclipse.app

Not sure why this codesigning fixes the problem. But seems to be a bug in the eclipse itself. Hope this helps someone.

debugger89
  • 2,108
  • 2
  • 14
  • 16
  • 4
    thanks, this is an exact fix to the issue, some details on why its happening is here https://support.apple.com/en-us/HT202491, basically Eclipse is having components that are not signed or expired, plus this issue is likely to happen after installing new software via eclipse marketplace update site mechanism which modifies the Content of the App bundle, all issues combined makes Gatekeeper block the App, and I guess this solution makes Gatekeeper trust the App bundle again. – Ravi Jul 29 '22 at 07:51
  • This worked for me, but I had to replace the path with `Eclipse Java.app`. – Christian Mar 08 '23 at 12:29
  • For more info checkout: https://developer.apple.com/forums/thread/684509 – Lekan Jul 15 '23 at 15:10
5

running this in terminal works for me :

sudo codesign --force --deep --sign - /Applications/Eclipse.app
Suraj Kudale
  • 61
  • 1
  • 5
5

I faced the same issue each time I restarted the Macbook pro M1 Max,(Note Eclipse was downloaded via Homebrew) and tried below but it turned out to be "/Applications/Eclipse.app: Is a directory"

sudo codesign --force --deep --sign - /Applications/Eclipse.app

the issue was the file structure Eclipse saved was different (you can check the file structure by cd to the Eclipse through the terminal) as per the file structure, the path was

sudo codesign --force --deep --sign - /Applications/Eclipse\ JEE.app

I hope this helps someone.

Ranga
  • 141
  • 2
  • 6
2

Move the Eclipse app in application folder to bin, reinstall from your .dmg file and it will work again with all your temporary files and setup intact.

user4157124
  • 2,809
  • 13
  • 27
  • 42
2

This is what actually worked for me:

sudo codesign --force --deep --sign - /Applications/Eclipse\ Java.app

Emmanuel
  • 21
  • 1
1

I had a project that was creating log files in the /Applications/Eclipse.app/Contents/MacOS/ folder. This caused the signature mismatch. If this happens for you, cd into the above directory remove everything other than the default (eclipse directory). After that, debugger99's suggestion of signing will work.

sudo codesign --force --deep --sign - /Applications/Eclipse.app

singhspk
  • 2,389
  • 3
  • 23
  • 28
0

I was having the same issue (also macOS Monterey) and I just re-downloaded the dmg, and when moving the app into Applications, it asked me if I wanted to replace the current Eclipse app and I said yes. Now it opened up just fine and is working.

0

The Issue does not occur for every restarts, but it happened the below cmd worked for me:

sudo codesign --force --deep --sign - /Applications/Eclipse.app

Thought of creating an alias for it in ~/.zshrc

alias signEclipse="sudo codesign --force --deep --sign - /Applications/Eclipse.app"
Sushant Verma
  • 899
  • 7
  • 8
0

For Apple Silicon Macs (M1/M2), this command worked:

xattr -d com.apple.quarantine /Applications/eclipse.app

I used it in order to launch BIRT Designer flavor of eclipse.

chross
  • 61
  • 1