Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #166498

Re: How do I set different JAVA_HOME for different users?

From "Thomas Schmitt" <scdbackup@gmx.net>
Newsgroups linux.debian.user
Subject Re: How do I set different JAVA_HOME for different users?
Date 2016-04-07 14:00 +0200
Message-ID <rlgLo-3f5-19@gated-at.bofh.it> (permalink)
References <rlfFE-2v3-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

> The trouble is, often you need to know where to look,

The collective brain here always has interesting proposals. :))


> A shell script exactly like that was what what I started out with!
> It worked ONLY for that terminal.

You'd need to put start of the whole android development into that
script. So that all processes started for that purpose inherit the
variable.


> I never thought to try 'man bash'.

It can be frustrating to search for answers in there.
Often you find the explanation why it works only after inventing a
way how it works.

In this case, bash is only involved as a common ancestor of all
your user's activity. When new processes get started, they normally
are subject to these statements from man 2 fork, when the parent process
duplicates itself:

  The
  new process, referred to as the child, is an  exact  duplicate  of  the
  calling  process,  referred  to as the parent, except for the following
  points: [... none of them applies to environment variables ...]

and man 3 execl, when the child process replaces the parent program by
the program which shall get started:

  For those forms not containing an envp pointer ( execl(), execv(), exe‐
  clp(),  and  execvp()), the environment for the new process image shall
  be taken from the external variable environ in the calling process.


Other ancestor programs (like systemd or the desktop) may of course
decide not to forward all their environment but construct a new set
of variables for those processes which they launch.


Have a nice day :)

Thomas

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

How do I set different JAVA_HOME for different users? Jaimz Fairfax <captain_jtf@yahoo.co.uk> - 2016-04-06 10:20 +0200
  Re: How do I set different JAVA_HOME for different users? "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-06 11:10 +0200
    Re: How do I set different JAVA_HOME for different users? SOLVED Jaimz Fairfax <captain_jtf@yahoo.co.uk> - 2016-04-06 16:10 +0200
      Re: How do I set different JAVA_HOME for different users? SOLVED Mark Fletcher <mark27q1@gmail.com> - 2016-04-06 16:20 +0200
      Re: How do I set different JAVA_HOME for different users? "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-06 18:00 +0200
        Re: How do I set different JAVA_HOME for different users? Jaimz Fairfax <captain_jtf@yahoo.co.uk> - 2016-04-07 12:50 +0200
          Re: How do I set different JAVA_HOME for different users? "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-07 14:00 +0200

csiph-web