Jump to content

How to keep enviroment variables after reboot the system ..?


Guest Hechizebrio
 Share

Recommended Posts

Guest Hechizebrio

Hello all!!

 

I did an install of JDK but I don't know how keep the enviroments variables (JAVA_HOME and PATH) after reboot the system, I don't want to write every time " export...." to run java. somebody can help me with this issue...?

 

 

Thanks!!!

Link to comment
Share on other sites

First you can change the jre/jdk startup to actually set them :D

 

I used to do this with a particular jre which was needed by Oracle8i.

If I remember though if you have different ones you also need to set the linker libary path (LD_LIBRARY_PATH) or times might have changed :D

 

Second way is to do it globally in /etc/(something) .

Or you can do it per user

Depending on the shell/intepreter .. it depends on the scope you want to apply to it.

If you have different JDK versions you might want to just make a script that sets them seperately...

Or for per user .... It depends if you want them per interpreter loaded OR per user login... (i.e. you can bypass with su <user> instead of su - <user>

 

The man pages for the intepreter are the place to look.

man csh/sh/bash etc....

Im in Solaris mood right now and I remember the csh is the .cshrc or .login depending on scope but the bash stuff (is .bash_profile ) etc.

I don't wanna tell you wrong but man .bash_profile is a good start :D

Link to comment
Share on other sites

Precisely! This came from Sun with instructions in their j2re file:

 

Create java.sh / java.csh (depending on shells) in etc/profile.d/ containing:

 

JAVA_HOME=/usr/java/j2re1.4.2_01

export JAVA_HOME

PATH=$PATH:$JAVA_HOME/bin

export PATH

 

(of course path in first line must match your system)

This works for all users.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...