Can't export variable in .bash_profile ubuntu 18.04

Solution 1:

Probably not what you're looking for, but I don't believe .bash_profile exists. Try adding that export command to .profile instead.

Aka, echo "export SPRING_PROFILES_ACTIVE=local" >> .profile

(Tested on Debian Stretch; I don't use Ubuntu, but the fact you said "I create .bash_profile" is odd)

Solution 2:

For your reference:

Below is login shell startup file processing diagram for different shells

shell_startups

(Credit for diagram is going to Shantanu Kulkarni who posted it in yEd gallery)