Skip to content

Commit e407cf2

Browse files
committed
Adds a bash script to modify the local Eclipse.app
to make it executable on macOS
1 parent a009473 commit e407cf2

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

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

+3-1
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
@@ -41,6 +41,8 @@ The following steps are necessary to run a custom Eclipse on modern macOS system
4141
You can now start your custom `Eclipse.app` with a double click on it.
4242
If macOS asks if you really want to start the "broken" app, select `Run`.
4343

44+
All modifications on the local `Eclipse.app` can also be made with [this script](../scripts/fix-eclipse-app-macos.sh).
45+
4446
---
4547

4648
## Currently known issues

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)