Environment variables

I need to set the environment variable for use in a web application. I don´t know how to create for use in Mojave OS. Can anyone give me some directions for setting that environment variable.


Thanks.

Macbook (2015 or later)

Posted on Jan 4, 2019 9:04 AM

Reply
4 replies

Jan 4, 2019 9:32 AM in response to John Galt

Hello Jhon,


I am developing a web application and I need to read data from an environment variable. I wrote export VARIABLE = /path/file.properties in the file /etc/profile but the application does not find that variable when executing.


When I execute in the terminal app then next command launchctl setenv VARIABLE $ VARIABLE finds it, but every time I restart my MAC, I have to enter at terminal app and run launchctl .....


How to permanently set environmet variable?


Thank you.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Environment variables

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.