Skip to content

Commit eeb30d6

Browse files
committed
Merge remote-tracking branch 'ibex/main'
2 parents 187d060 + f3ae400 commit eeb30d6

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

doc/how-to-run-eclipse-on-macos.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to run a custom Eclipse on macOS
22

3-
(Apparantly, this was only tested on AMD64-based Macs = Intel Macs only!)
3+
(Apparantly, this was successfully tested on AMD64-based and ARM64-based Macs.)
44

55

66
## Problem
@@ -21,15 +21,15 @@ The following steps are necessary to run a custom Eclipse on modern macOS system
2121
- Allow your Terminal the privileges to `Full Disk Access` and `Developer Tools` in the `Settings` app of macOS.
2222
- `Settings` -> `Privacy & Security` -> `Full Disk Access` -> Add `Terminal` app and/or toggle its setting to `on`.
2323
- `Settings` -> `Privacy & Security` -> `Developer Tools` -> Add `Terminal` app and/or toggle its setting to `on`.
24-
- Install the recommend JDK, e.g., [Eclipse Temurin JDK 17](https://adoptium.net/de/temurin/releases/?os=mac&arch=x64&package=jdk&version=17).
24+
- Install the recommend JDK, e.g., [Eclipse Temurin JDK 21](https://adoptium.net/de/temurin/releases/?os=mac&arch=x64&package=jdk&version=21).
2525
- Download the custom Eclipse archive (e.g., from https://emoflon.org or GitHub).
2626
- Extract it with a double click.
2727
- Right click on `Eclipse.app` -> `Show Package Contents` -> Navigate into `Contents`.
2828
- Open `Info.plist` with a text editor of your choice (e.g., [VSCodium](https://vscodium.com/)).
2929
- Open a Terminal window and run `$ /usr/libexec/java_home`
30-
- This should return you a single path to your default Java JDK installation, e.g., `/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home`
31-
- Leave your Terminal window open and return to your text editor (showing the contents of `Info.plist`). Scroll down into the block below the line `<key>Eclipse</key>` and enter your Java JDK's path with this syntax: `<string>-vm</string><string>$YOUR_PATH/bin/java</string>`
32-
- Example: `<string>-vm</string><string>/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/java</string>`
30+
- This should return you a single path to your default Java JDK installation, e.g., `/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home`
31+
- Leave your Terminal window open and return to your text editor (showing the contents of `Info.plist`). Scroll down into the `<array>` block below the line `<key>Eclipse</key>` and enter your Java JDK's path with this syntax: `<string>-vm</string><string>$YOUR_PATH/bin/java</string>`
32+
- Example: `<string>-vm</string><string>/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/bin/java</string>`
3333
- Save the file, close your editor, and open your Terminal window again.
3434
- Navigate the Terminal window to your Eclipse folder using `cd $FOLDER_NAME`, e.g., `cd Downloads/eclipse`.
3535
- Verify that your custom `Eclipse.app` is located in the currently selected folder via `ls`.
@@ -39,7 +39,9 @@ The following steps are necessary to run a custom Eclipse on modern macOS system
3939
- As for the `Terminal` app, add the privileges for `Full Disk Access` and `Developer Tools` to your `Eclipse.app`.
4040

4141
You can now start your custom `Eclipse.app` with a double click on it.
42-
If macOS asks if you really want to start the "broken" app, select `Run`.
42+
If macOS asks if you really want to start the "broken" app, select `Run`. If there is no option to run it, you can force macOS into opening it by going to the "Privacy and Security" settings and scrolling down to the bottom.
43+
44+
All modifications on the local `Eclipse.app` can also be made with [this script](../scripts/fix-eclipse-app-macos.sh).
4345

4446
---
4547

scripts/fix-eclipse-app-macos.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# This script patches the `Info.plist` file in the Eclipse.app to
4+
# properly make/mark it executable.
5+
#
6+
# author: Max Kratz <[email protected]>
7+
# date: 2024-11-15
8+
9+
set -e
10+
11+
FILE="./Eclipse.app/Contents/Info.plist"
12+
JAVA=$(/usr/libexec/java_home)
13+
STRING=" <string>-vm</string><string>$JAVA/bin/java</string>"
14+
15+
if [ ! -f $FILE ]; then
16+
echo "=> Eclipse.app not found in local folder."
17+
exit 1;
18+
fi
19+
20+
if grep -Fq "$STRING" $FILE > /dev/null
21+
then
22+
echo "=> Info.plist already patched."
23+
else
24+
echo "=> Patching Info.plist."
25+
sed -i -e '/.eclipse_keyring/a\'$'\n'"$STRING" $FILE
26+
fi
27+
28+
sudo codesign --force --deep --sign - ./Eclipse.app
29+
xattr -d com.apple.quarantine ./Eclipse.app || true
30+
31+
echo "=> Done."

0 commit comments

Comments
 (0)