Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8465897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:11:03+00:00 2026-06-10T15:11:03+00:00

It looks like Ubuntu uses ~/.bashrc , ~/.bash_profile , ~/.pam_profile , /etc/environment , and

  • 0

It looks like Ubuntu uses ~/.bashrc, ~/.bash_profile, ~/.pam_profile, /etc/environment, and /etc/profile in very similar ways. I’d like to be able to add a configuration to one of these (which ever is the appropriate one) to set ANT_HOME to be the absolute path to my Ant installation’s root directory (happens to be /opt/apache/ant/1.8.4/apache-ant-1.8.4/). This variable needs to be “honored” as is any normal env var, where I can open up a terminal and echo it at any time. It would also be nice if I could set this in such a way for Java to read it in at runtime from a System.getProperty("") call.

  • Which file do I use?
  • How do I actually set it so that it meets my requirements above?

Thanks in advance for any help or pointers here!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:11:04+00:00Added an answer on June 10, 2026 at 3:11 pm

    For global settings, system-wide environment variables

    • Use /etc/environment
    • don’t use /etc/profile, or /etc/bash.bashrc

    From this page :

    /etc/environment […] is
    specifically meant for system-wide
    environment variable settings. It is
    not a script file, but rather consists
    of assignment expressions, one per
    line. Specifically, this file stores
    the system-wide locale and path
    settings.

    Using /etc/profile is a very Unix-y way to go, but its functionality is greatly reduced under Ubuntu. It exists only to point to /etc/bash.bashrc and to collect entries from /etc/profile.d .

    On my system, the only interesting entry entry in profile.d is /etc/profile.d/bash_completion.sh .

    For local or per-user settings

    A previous version of the Ubuntu page recommended ~/.pam_environment , but the page currently suggests that if that doesn’t work, you should use

    • ~/.profile – This is probably the
      best file for placing environment
      variable assignments in, since it gets
      executed automatically by the
      DisplayManager during the startup
      process desktop session as well as by
      the login shell when one logs-in from
      the textual console.

    • ~/.bash_profile or ~./bash_login – If one of these exists, bash executes it instead of “~/.profile” when bash is started as a login shell. Bash will prefer ~/.bash_profile to ~/.bash_login. […] These files won’t influence a graphical session by default.”

    • ~/.bashrc – “… may be the easiest place to set variables”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to install jdk1.6 onto my Ubuntu 10.04. However, It looks like
I noticed ubuntu 10.04 removed the spidermonkey package. Rhino looks like it's still there
I'm trying to compile Objective-C code on Ubuntu 12 Linux. main.m looks like this:
So I am running code that looks like this on Ubuntu 11.4 and Python
I'm running Ubuntu. My Apache2 default file looks like this: <VirtualHost *:80> ServerAdmin webmaster@localhost
Looks like this question has been asked thousand times already, but each person's configuration
Looks like while( condition ) { //do stuff } is completely equivalent to for(
Looks like ExpressionTrees compiler should be near with the C# spec in many behaviors,
Looks like there is no Load event for usercontrol on the CF. I'm used
Looks like XSD.exe is not delivered as a part of Visual Studio 2010. what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.