Depending on how one starts IntelliJ it won’t pick up the variables from .bash_profile.
Variables set in that file are only visible in bash and child processes. So IntelliJ will only know about altered variables if its started from the bash.
If its started from the GUI, it will inherit thats environment.
Also, back in the days when I used IntelliJ (for other languages) they often ignored settings from the environment and let you choose an “SDK” per project. Even though the field is labeled SDK it meant compiler and stdlib version to use for any language.