How Do You Set Environment Variables in Linux?

How Do You Set Environment Variables in Linux?
Contents

How do I set environment variables in Linux?

Persisting Environment Variables for a User

  1. Open the current user’s profile into a text editor. vi ~/.bash_profile.
  2. Add the export command for every environment variable you want to persist. export JAVA_HOME=/opt/openjdk11.
  3. Save your changes.

How do you set environment variables?

Windows 7

  1. From the desktop, right click the Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced system settings link.
  4. Click Environment Variables. …
  5. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable.
Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.