• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Export automatically...

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, in windows XP, you could set the environment variable PATH to remember the java bin directory... In windows 98 or later, you could use the set path command... In Linux, we use the export command. But I don't want to do this everytime I start my computer. Any idea on how to get around this problem? I have heard of editing the profile but couldn't find the right sources to teach me how to do that... Thanks!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can put those kinds of definitions into your shell resource file. That's located in your home directory, and called something like ".tcshrc" (for the TCSH shell) or ".bashrc" (for the bash shell) or something similar. THose get executed automatically when a new shell starts.
If you put it into the ".profile" file (also in your home directory), it will be executed no matter what shell you use (if I remember correctly, haven't actaully tried that myself).
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depending on your linux-flavour, different files might be appropriate.
To investigate, which file is used for your linux, you could search where the path is set so long:

Top-candidates are /etc/profile and /etc/bash.bashrc
For these system-wide configuration-files you need to be root to write to them.
Insert

with your favourite editor.

You don't need the 'export' if it is called later in the file.

If different users of the machine need different settings, the situation is more complicated.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's actually probably about 5 different places you can set profile info, depending on whether you want it known to a single user or all users, what shells you want affected, and so forth. It takes a little digging, but it's there.
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic