private vs. public JRE in different OSs

Discussion in 'Java' started by lbrtchx@gmail.com, Dec 23, 2008.

  1. Guest

    ~
    The installation instructions for the JDK for Linux and Windows:
    ~
    http://java.sun.com/javase/6/webnotes/install/jdk/install-linux.html
    ~
    http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html
    ~
    give a different account in regards to the need and difference of
    private vs. public JREs
    ~
    Why is that?
    ~
    What could you do without the private JRE? Just compile POJOs? What
    are the tools that need the private JRE?
    ~
    Why don't browsers using the "public JRE" use the "private" copy?
    ~
    Thanks
    lbrtchx
    , Dec 23, 2008
    #1
    1. Advertising

  2. On Tue, 23 Dec 2008 14:58:38 -0800, lbrtchx wrote:

    > ~
    > The installation instructions for the JDK for Linux and Windows:
    > ~
    > http://java.sun.com/javase/6/webnotes/install/jdk/install-linux.html
    > ~
    > http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html
    > ~
    > give a different account in regards to the need and difference of
    > private vs. public JREs
    > ~
    > Why is that?
    >

    Remember that, unlike Windows, Linux is a true multi-user system.

    You have the choice of installing the JRE in /usr/java where its publicly
    available to any user or in a user's private space where only that user
    can access it.

    > ~
    > What could you do without the private JRE?
    >

    Use a publicly installed JRE.

    > Just compile POJOs?
    >

    That depends on what classfiles are in the CLASSPATH you're using.

    > What are the tools that need the private JRE?
    >

    You're missing the point. Normally a JRE is installed so all users get
    access, but you might want to install a different JRE + JDK privately.
    The usual reason for this is so the impact od a Java upgrade can be
    evaluated without affecting anybody else's Java development environment
    or any production code running on that host. For instance if everybody is
    on 1.4 but you're considering an upgrade to Java 6 this is the way to
    find what, if any effect the upgrade might have

    > ~
    > Why don't browsers using the "public JRE" use the "private" copy?
    >

    Depends where they're being run. If its being run by a user with a
    privately installed JRE the browser will use that. If its being run in
    some other user, then the publicly installed JRE will be used - unless
    they too happen to have a private JRE installed.


    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
    Martin Gregorie, Dec 24, 2008
    #2
    1. Advertising

  3. Guest

    > Every time this F.A.Q. is raised here, the answer usually
    > boils down to "the JDK uses a private JRE because the docs
    > say it will." Usually a link is provided to the language spec.
    >
    > I *dare* someone to explain what bad thing might happen if
    > the JDK tools used the public JRE, and if the JDK only
    > shipped the single, public JRE in the bundle. In fact
    > I double-dare you!


    Don't know if it has anything to do with security but...

    A default Java install on a Un*x system does NOT mandate
    to be the admin (i.e. "root") while a default Windows
    install forces you to give the admin account.

    As a security measure every single Java VM I install on
    a server is installed in a user account. I just set up
    a dedicated server (for a client of mine) running Tomcat.
    Both the JVM and Tomcat are installed in a user account
    and Linux's iptables is used to transparently redirect
    request to the privileged ports 80 and 443.

    The reason to install a "private" JVM on linux is
    simple: security. There is simply no compelling reason
    to install the JVM and Tomcat and to run them as root
    when they can be installed in a dumb user account.

    Could this be something similar for Windows?

    I *know*, for having been bitten by that, that you
    cannot install the "regular" JRE without being the
    admin on an XP system... Could this be that the
    "private JRE" can be installed without needing to
    be the admin of the machine? For that would be
    a *very* compelling reason to have a "private JRE".

    Driss
    , Dec 24, 2008
    #3
  4. Eric Sosman Guest

    Wayne wrote:
    > [...]
    > I *dare* someone to explain what bad thing might happen if
    > the JDK tools used the public JRE, and if the JDK only
    > shipped the single, public JRE in the bundle. In fact
    > I double-dare you!


    Suppose you're running happily with Java 1.X -- JDK,
    browsers, WebStart, everything in sight, they're all using
    the shared JRE. Which is, as I said, Java 1.X.

    Java 1.Ybeta becomes available, and you'd like to try it
    out and see if the new Shakedown framework (it's a lot like
    Collections, but more, um, robust) is worth using. If you're
    dogmatic about having only one JRE on your system and sharing
    it with everything, then you're stuck with the prospect of
    migrating *everything* to Java 1.Ybeta all at once, even if
    it turns out to be soggy slow and bug-infested ...

    However: Once the final Java 1.Y comes out and you decide
    you're comfortable with it, you *can* get your JDK to use the
    same JRE as everything else does. The installation won't set
    it up for you that way all unaided, but if you're a capable
    sort of person you can do some post-installation surgery and
    then get rid of one or the other of the JRE's. Myself, I feel
    it's not worth the effort: The JRE weighs in at 85MB, and I've
    got 89GB of unused disk space on the machine I'm using at this
    moment. Increasing my free space by less than 0.1% just ain't
    worth dithering over.

    CPU cycles, RAM bits, and disk space were scarce and
    expensive when I got into this industry. All three are now
    cheap and plentiful, and the parsimonious habits developed
    during the time of scarcity are now hard to justify -- also
    hard to shake, but that's a rant for another time.

    --
    Eric Sosman
    lid
    Eric Sosman, Dec 24, 2008
    #4
  5. Guest

    Eric,
    ~
    wasn't the JAVA_HOME environment variable devised for the kind of
    problem you are describing?
    ~
    I would have jre and/or jdk installations in different paths and then
    simply go when the OS starts up:
    ~
    export PRE_PATH=$PATH
    ~
    and then each time I would like to (re)set the java version:
    ~
    export JAVA_HOME=<whicever new path to it>
    export CLASSPATH=<whicever new classpath (if necessary)>
    export PATH=$JAVA_HOME/bin:$PRE_PATH
    ~
    you could also easily also reset (or not) browsers ...
    ~
    lbrtchx
    , Dec 25, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    1
    Views:
    1,327
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    533
    SpamProof
    Oct 21, 2003
  3. qazmlp
    Replies:
    19
    Views:
    777
    Daniel T.
    Feb 4, 2004
  4. DaveLessnau
    Replies:
    3
    Views:
    414
    Howard
    May 16, 2005
  5. Thorben Krueger
    Replies:
    2
    Views:
    286
    Thorben Krueger
    Sep 11, 2008
Loading...

Share This Page