[SOLVED]setting java_home and path in mageia 4

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED]setting java_home and path in mageia 4

Postby robertbond » Aug 15th, '14, 01:48

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
Last edited by robertbond on Aug 21st, '14, 02:46, edited 1 time in total.
robertbond
 
Posts: 30
Joined: May 30th, '13, 09:45

Re: setting java_home and path in mageia 4

Postby doktor5000 » Aug 15th, '14, 07:31

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.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: setting java_home and path in mageia 4

Postby robertbond » Aug 15th, '14, 11:59

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...
robertbond
 
Posts: 30
Joined: May 30th, '13, 09:45

Re: setting java_home and path in mageia 4

Postby doktor5000 » Aug 15th, '14, 18:57

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.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: setting java_home and path in mageia 4

Postby robertbond » Aug 19th, '14, 15:42

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) ?
robertbond
 
Posts: 30
Joined: May 30th, '13, 09:45

Re: setting java_home and path in mageia 4

Postby doktor5000 » Aug 19th, '14, 19:59

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
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: setting java_home and path in mageia 4

Postby robertbond » Aug 20th, '14, 13:43

oke thank you, i will try so for me its solved...
robertbond
 
Posts: 30
Joined: May 30th, '13, 09:45

Re: setting java_home and path in mageia 4

Postby isadora » Aug 20th, '14, 17:22

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. ;)
..........bird from paradise..........

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
—Antoine de Saint-Exupéry
User avatar
isadora
 
Posts: 2766
Joined: Mar 25th, '11, 16:03
Location: Netherlands


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest