-
Notifications
You must be signed in to change notification settings - Fork 576
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
respect JAVA_HOME env in linux/mac launch scripts #6008
base: master
Are you sure you want to change the base?
Conversation
do you have a mac to test the scripts? can you update the forge.command script too? #5548 |
No, I don't have a mac to test scripts, but the changes I made are POSIX-compliant. It should work the same with every default shell on any OS (dash, bash, zsh, etc..).
AFAIK there's no difference between ".sh" and ".command" file extensions in MacOS. (see https://apple.stackexchange.com/questions/24262/what-is-the-difference-between-command-tool-and-sh-file-extensions) |
I think MacOS reacts differently with the ".command" file extension. so either copy the .sh to the .command file extension too, or make the .command call the .sh if able |
Oh I missed that you was talking about But with "forge.command" it seems like it's possible to copy "forge.sh" script with minimal changes. First, the she-bang (macos uses zsh shell instead of bash):
I've tested this script both in bash and zsh (on Linux machine) and there's only one line that would work differently in zsh:
or replace it with
|
it seems we can still force MacOS to use sh for the *.command file, or would that be ignored? forge/forge-gui-desktop/src/main/config/forge.command Lines 1 to 3 in 78bff0a
|
This PR has not been updated in a while nad has been marked on stale. Stale PRs will be auto closed |
@tehdiplomat @Agetian @kevlahnota can someone check this MR? |
@Hanmac I think it's fine however once my PR is merged along with Java 17 update, the -illegal-access permit shouldn't work and should be removed and we need to use add opens paramater to cleanup the code. |
Agreed with @kevlahnota 👍 |
Forge should use java version set by JAVA_HOME first and if it's not set - only then use plain "java" invocation.
Also fixed warnings reported by
shellcheck
utility:cd
command can fail.." => "cd ... || exit"local foo=...
" => "local foo; foo="