cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to set JAVA_HOME environment in bash shell

Former Member
0 Kudos

hi all,

I am a new user in our sap environment in solaris boxes. we use WRQ Reflection to run the X-Windows for using Java tools like Visual Administrator.

Since my profile is new,the environment variable JAVA_HOME for my user profile is not set.

The default shell is bash.but i dont know how to set the enviroment variable to start the java tools.

Please help me where can i find the .bash_profile and how to set it..( i can execute unix commands, but i am not an expert )

Help would be greatly appreciated and rewarded.

Thank you all for your time.

Addy

Accepted Solutions (0)

Answers (2)

Answers (2)

hannes_kuehnemund
Active Contributor
0 Kudos

moved to the Unix forum, as this question is not Linux related

markus_doehr2
Active Contributor
0 Kudos

Profiles are always in your home directory.

Logon as root

vi .bash_profile

then press "SHIFT" "G"

enter

export JAVA_HOME=<yourpathtojava>

- press "ESC"

- enter ":x"

logoff - and logon as root.

Then check with

echo $JAVA_HOME

if the path is set.

Markus

Former Member
0 Kudos

Markus,

Thanks for your quick reply.

I couldn't find the .bash_profile in either /home OR /home/<my_user_id>

instead i see .bash_history file under /home/<my_user_id>

i cannot login as root.but i think i have the permissions to edit and modify files ( i could do with other files ) how do i check my own permission ?

Can i do it on my own if i have the necessary permission or i need unix admins help ?

Please help..simple thing..but eating my brain for 2 days..!

Appreciate your time.

Addy

markus_doehr2
Active Contributor
0 Kudos

> i cannot login as root.but i think i have the permissions to edit and modify files ( i could do with other files ) how do i check my own permission ?

SAP installation must be done as user "root". You don't necessarily need to logon as root but can you an

su - root

Markus

Former Member
0 Kudos

I don't know the root password to switch the user ( su ).

Is this mandatory to have root permissions to set the environment variable ?

Can i do it with you guys help or I need to request solaris admins help as i may not have necessary permissions. since i am able to edit and modify other files, i think i should be able to do it.

Please help..

Addy

Former Member
0 Kudos

when we try to su - root , we cannot use our password which is meant for our id and i don't have root password.

environment setting has to be done by the root or we can do it if we have necessary permissions ?

appreciate your time and help.

Addy

markus_doehr2
Active Contributor
0 Kudos

su - root means

"S witch User"

the "dash" means that the environment from the new user should be taken

the second argument is the username

Bash is not a default shell on Solaris so it won´t use the normal enviornment.

Create a new file with the name

.profile

in your users home directory and set

export JAVA_HOME=<yourpath>

Markus

Former Member
0 Kudos

Markus,

I found the jdk path - /usr/jdk/j2sdk1.4.2_12

And tried to export the JAVA_HOME and Ofcourse it works..Thanks !

i was able to start the application..but its only for the current session.

( I used export JAVA_HOME=/usr/jdk/j2sdk1.4.2_12 which is my jdk location )

But, when i tried to see .profile or .bash_profile to make it permenant, none is found.

I tried to create a .profile as you said..but when i tried to save the file after putting export command in there, i am not able to save,getting an error " Operation not applicable "

Is that because i don't have enough permissions ? How do i check my own Permissions ?

Please help...

Addy

markus_doehr2
Active Contributor
0 Kudos

> I tried to create a .profile as you said..but when i tried to save the file after putting export command in there, i am not able to save,getting an error " Operation not applicable "

I suggest you contact your Unix admins. Usually a user should be able to write/create files in his home directory.

Markus

Former Member
0 Kudos

when i told this to my colleague, he asked me to create any file ( not a .profile )and put the commands whatever i want and execute it startup.

i will try for that option..please help if you have any idea..

Thanks for all your efforts..

Regards,

Addy

Former Member
0 Kudos

Unix admin helped me..thanks everyone.