Using Private JRE with JRuby, Windows,Linux & Mac

The readme that comes with Java SE6 (JRE) talks about private runtimes.
A few questions–

Is the private runtime executed with the full path to bin/java
e.g /home/john/java/jre6/jrel.6.0_18/bin/java -jar
jruby-complete-1.4.0.jar -e “puts ‘Hello Private’”
or is there another method, preferred or otherwise?

In the readme it states that with windows, bin/java.exe is optional. In
this case how is the private jre run?

Having virtually no knowledge of the mac OSX, can a private jre be used
and as it does not appear in the Sun downloads, where does it come from?

Regards
Paul F Fraser


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Paul,

On Sat, Dec 26, 2009 at 1:58 AM, Paul F Fraser [email protected]
wrote:

Is the private runtime executed with the full path to bin/java e.g
/home/john/java/jre6/jrel.6.0_18/bin/java -jar jruby-complete-1.4.0.jar -e
“puts ‘Hello Private’”
or is there another method, preferred or otherwise?

You could just add the Java’s bin directory to your $PATH (%PATH% on
Windows) and then do java … .

But typically you don’t need to execute java directly. Typically,
folks just use jruby command (be it jruby.exe custom launcher on
Windows or shell launcher script). The launchers typically look at
JAVA_HOME env. variable, and that’s how you set the location of the
Java VM.

On Windows, the launcher script also looks into the registry, so
setting JAVA_HOME is optional.

In the readme it states that with windows, bin/java.exe is optional. In
this case how is the private jre run?

This is optional only “when redistributing the JRE on Microsoft
Windows as a private application runtime (not accessible by other
applications) with a custom launcher”.

And we do have custom JRuby launcher on Windows which links against
jvm.dll and executes the JVM in-process, so java.exe is indeed
optional.

Having virtually no knowledge of the mac OSX, can a private jre be used and
as it does not appear in the Sun downloads, where does it come from?

I was under impression that private jre is something that can be done
manually, just chopping off the bits from the official JVM/JRE. But
this area where I’m not 100% sure.

Thanks,
–Vladimir

P.S. I might misunderstood you questions though… :slight_smile:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Vladimir S. wrote:

You could just add the Java’s bin directory to your $PATH (%PATH% on

jvm.dll and executes the JVM in-process, so java.exe is indeed

Thanks,
–Vladimir

P.S. I might misunderstood you questions though… :slight_smile:

Hi Vladimir,
In each case (win,linux & mac) I wish to run my application with a
“private dedicated jvm”, to eliminate any possibility of interfering
with any other installed applications using the jvm pointed to by
JAVA_HOME and to keep the jvm under my applications control to ensure
that latest zone files etc. are installed.
The readme included with the jre install, makes it quite clear that use
of a private jvm is a normal case, but does not give any guidance as to
the detail.
This link gives some pointers to running multiple versions but does not
mention the private aspect of the install. It suggests using multiple
JAVA_HOME variables.

Since my first email to the list I have discovered that the mac java is
downloadable from Apple but I have no idea if apple allows private
dedicated installs
Paul


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Like Vladimir I am not 100% clear on your question, so apologies ahead
of
time if I’m answering the wrong question.

We have distributed two desktop applications that run on Java + JRuby.
It
runs on Windows, Mac, and Linux (thank you, Mr. JVM). In all three cases
the
application is delivered as a single jar file; we use jarjar [1] to
combine
jruby-complete and our other dependences into one file.

  1. On Windows we deliver an NSIS [2] installer. The installer deposits
    our
    jar file, a Launch4J [3] executable, and a Java 6 JRE that is local to
    the
    application. The Launch4J executable is for launching the application;
    when
    the executable is built, Launch4J has configured it to launch our
    application using the private JRE.

  2. On Mac we deliver a .app bundle. In this case we do not bundle a
    private
    JRE, since we do not know of any way to do this. Instead, we have
    configuration in the bundle’s plist file that specifies the minimal
    version
    of Java we depend on. In essence, we assume the user has Java installed
    system-wide; chances are they do given that it is part of the complete
    operating system package and is delivered via Software Update.

  3. On Linux we deliver our jar and a shell script. We do not attempt to
    deliver a private JRE. In this case, we assume that a Linux user capable
    of
    launching our application with a shell script is also capable of
    installing
    Java themselves.

Windows is our primary target platform, so most of our focus (with
respect
to installers and application delivery) is on Windows. There has not
been
demand to improve this process on Mac or Linux, so we implemented what
we
consider a reasonable minimum.

I hope this answers your question.

Matt Fletcher
Atomic Object

[1] JarJar Links: Google Code Archive - Long-term storage for Google Code Project Hosting.
[2] NSIS: NSIS Wiki
[3] Launch4J: http://launch4j.sourceforge.net