Page 1 of 1

[SOLVED]setting java_home and path in mageia 4

PostPosted: Aug 15th, '14, 01:48
by robertbond
hello all good morning from indonesia....
I want ask about set java_home and path in mageia 4, everything is fine and I found from oracle (http://docs.oracle.com/cd/E19509-01/820 ... index.html), but after reboot i running my android studio and android studio said I need to set java_home again, so how to set java_home and path in mageia 4, so I don't need to set every reboot???

:D

Re: setting java_home and path in mageia 4

PostPosted: Aug 15th, '14, 07:31
by doktor5000
Why do you want to set it at all, and what java do you use currently? Usually you should switch between different java installations via
Code: Select all
update-alternatives --config java


If you need to set java home and path manually, put it into a .sh file, make it executable and stick that in /etc/profile.d/ with a meaningful name.

Re: setting java_home and path in mageia 4

PostPosted: Aug 15th, '14, 11:59
by robertbond
I need set java for android studio, now i use export JAVA_HOME=jdk-install-dir and export PATH=$JAVA_HOME/bin:$PATH for set in my mageia... but after reboot I need to set again before running android studio...

Re: setting java_home and path in mageia 4

PostPosted: Aug 15th, '14, 18:57
by doktor5000
doktor5000 wrote:If you need to set java home and path manually, put it into a .sh file, make it executable and stick that in /etc/profile.d/ with a meaningful name.

Re: setting java_home and path in mageia 4

PostPosted: Aug 19th, '14, 15:42
by robertbond
so i need create .sh file in /etc/prodile.d/ and the contents is export JAVA_HOME=jdk-install-dir, export PATH=$JAVA_HOME/bin:$PATH. and make it executable(chmod 777) ?

Re: setting java_home and path in mageia 4

PostPosted: Aug 19th, '14, 19:59
by doktor5000
Just checked, does not even need to be executable, as those files are only sourced by a shell, specifically via /etc/profile.
Check e.g. http://bash.cyberciti.biz/guide//etc/profile.d or http://unix.stackexchange.com/questions ... ofile-d-do or http://serverfault.com/questions/434321 ... d-executed for more details

Re: setting java_home and path in mageia 4

PostPosted: Aug 20th, '14, 13:43
by robertbond
oke thank you, i will try so for me its solved...

Re: setting java_home and path in mageia 4

PostPosted: Aug 20th, '14, 17:22
by isadora
Please don't forget to mark the topic [SOLVED].
You can do so, by editing the subject/title in the first message in this topic.
Write [SOLVED] to the left of subject/title, thanks ahead. ;)