Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > private vs. public JRE in different OSs

Reply
Thread Tools

private vs. public JRE in different OSs

 
 
lbrtchx@gmail.com
Guest
Posts: n/a
 
      12-23-2008
~
The installation instructions for the JDK for Linux and Windows:
~
http://java.sun.com/javase/6/webnote...all-linux.html
~
http://java.sun.com/javase/6/webnote...l-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
 
Reply With Quote
 
 
 
 
Martin Gregorie
Guest
Posts: n/a
 
      12-24-2008
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/webnote...all-linux.html
> ~
> http://java.sun.com/javase/6/webnote...l-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 |
 
Reply With Quote
 
 
 
 
neuneudr@yahoo.fr
Guest
Posts: n/a
 
      12-24-2008
> 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





 
Reply With Quote
 
Eric Sosman
Guest
Posts: n/a
 
      12-24-2008
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
http://www.velocityreviews.com/forums/(E-Mail Removed)lid
 
Reply With Quote
 
lbrtchx@gmail.com
Guest
Posts: n/a
 
      12-25-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSE 4 11-15-2006 02:40 AM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola Microsoft Certification 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSD 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd realexxams@yahoo.com Microsoft Certification 0 05-10-2006 02:35 PM
microsoft.public.dotnet.faqs,microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.dotnet.general,microsoft.public.dotnet.languages.vb Charles A. Lackman ASP .Net 1 12-08-2004 07:08 PM



Advertisments