Skip to content

Add shell fallback for JAVA_HOME detection#378

Open
vladd-g wants to merge 1 commit into
runningcode:masterfrom
vladd-g:fallback-way-to-retrieve-java-home
Open

Add shell fallback for JAVA_HOME detection#378
vladd-g wants to merge 1 commit into
runningcode:masterfrom
vladd-g:fallback-way-to-retrieve-java-home

Conversation

@vladd-g
Copy link
Copy Markdown

@vladd-g vladd-g commented Oct 30, 2024

The error "JAVA_HOME is not set" persisted even after setting the variable in shell config files:

| JAVA_HOME is not set.                                                                                |
| Please set JAVA_HOME so that switching between Android Studio and the terminal does not trigger a fu |
| ll rebuild.                                                                                          |
| To set JAVA_HOME: (using bash)                                                                       |
| echo "export JAVA_HOME=$(/usr/libexec/java_home)" >> ~/.bash_profile                                 |
| or `~/.zshrc` if using zsh.                                                                          |

Added a fallback mechanism to retrieve JAVA_HOME via shell command when System.getenv() fails to detect it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant