- https://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications
- https://stackoverflow.com/questions/829749/launch-mac-eclipse-with-environment-variables-set/36282543#36282543
- https://github.com/eclipse/ice/issues/288
- https://stackoverflow.com/questions/48084679/why-do-which-and-sys-which-return-different-paths#comment83144504_48084679
The current solution for Emacs users is to install a completely avoidable and unnecessary package (exec-path-from-shell) https://github.com/purcell/exec-path-from-shell/
By properly (trickily) including the $PATH, Emacs' users, especially new ones, will have improved user experience by eliminating the need to search "Why a package cannot find X executable" "Why the shell inside Emacs cannot find my programs" and waste time on install that unnecessary patchy package. Besides, the unnecessary complexity of exec-path-from-shel can also be avoided.
The most direct and simple solution is to use the existing shell (zsh or bash). This can be done by include a shell script inside the Emacs.app with something like this
#===================
#!/bin/shell script
source .zshrc and .bash_profile
execuate the Emacs binary inside the Emacs.app
#==================
However, there should be a better approach than this.
I want to make this simple patch and I think it is beneficial :)