Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a bash script to modify the local Eclipse.app to make it executable on macOS #125

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/how-to-run-eclipse-on-macos.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to run a custom Eclipse on macOS

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


## Problem
Expand Down Expand Up @@ -41,6 +41,8 @@ The following steps are necessary to run a custom Eclipse on modern macOS system
You can now start your custom `Eclipse.app` with a double click on it.
If macOS asks if you really want to start the "broken" app, select `Run`.

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

---

## Currently known issues
Expand Down
31 changes: 31 additions & 0 deletions scripts/fix-eclipse-app-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# This script patches the `Info.plist` file in the Eclipse.app to
# properly make/mark it executable.
#
# author: Max Kratz <[email protected]>
# date: 2024-11-15

set -e

FILE="./Eclipse.app/Contents/Info.plist"
JAVA=$(/usr/libexec/java_home)
STRING=" <string>-vm</string><string>$JAVA/bin/java</string>"

if [ ! -f $FILE ]; then
echo "=> Eclipse.app not found in local folder."
exit 1;
fi

if grep -Fq "$STRING" $FILE > /dev/null
then
echo "=> Info.plist already patched."
else
echo "=> Patching Info.plist."
sed -i -e '/.eclipse_keyring/a\'$'\n'"$STRING" $FILE
fi

sudo codesign --force --deep --sign - ./Eclipse.app
xattr -d com.apple.quarantine ./Eclipse.app || true

echo "=> Done."
Loading