Guest Hechizebrio Posted September 26, 2003 Report Share Posted September 26, 2003 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!!! Quote Link to comment Share on other sites More sharing options...
Gowator Posted September 26, 2003 Report Share Posted September 26, 2003 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 Quote Link to comment Share on other sites More sharing options...
Guest Squareball Posted September 26, 2003 Report Share Posted September 26, 2003 you need to put it in the .bashrc file. You (AFAIK) will also need to reboot after you add them to that file so that the changes take affect. Quote Link to comment Share on other sites More sharing options...
illogic-al Posted September 26, 2003 Report Share Posted September 26, 2003 not reboot, just re-login Quote Link to comment Share on other sites More sharing options...
Dr Thrall Posted September 26, 2003 Report Share Posted September 26, 2003 if u want to put variable for all users. u have to put them in /etc/profile or in /etc/profile.d/ Quote Link to comment Share on other sites More sharing options...
Guest kuchwas Posted September 27, 2003 Report Share Posted September 27, 2003 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.