• Post Reply Bookmark Topic Watch Topic
  • New Topic

installing java on linux questios  RSS feed

 
Ramina Nibilian
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post
I moved to linux from windows.
problem is i can not set environment variables in linux , for example java_home , tomcat_home , path ...
I found that i can use set , export ... . but they expire as i close the console .
is there any way to persist them in linux ? like windows


thank you
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're the admin of the machines, and want to grant access to everybody, the most popular way would be to edit /etc/profile, and add there 'export JAVA_HOME=/some/where/jdk-1.5'.

If you only want to set up java for a single user, let's say 'ramina', you would modify '/home/ramina/.bashrc' that way.

Feel free to visit the 'Linux/ Unix' group in section 3, 'Engineering'.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, do visit that forum -- because that's where this thread is going!
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest putting these commands in your user's .bashrc file (assuming that you are running bash as your shell). Messing with the files in /etc can be scary. I'm still trying to figure it all out as you may see from another thread I started in this forum.

Layne
 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yea, i am having a sytax problem with profile when i login via putty, but to be honest, i really havnt changed anything.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.bash_profile
In the user's home directory:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!