Skip to main content

private jre - how to distribute / install?

6 replies [Last post]
minka99
Offline
Joined: 2008-03-27
Points: 0

I have an app with a free trial windows distribution that has a suite of click and run examples. It uses java 6.0 update 11.

Now I'd like to bundle the jre with the free trial. I want these examples to be easy easy easy. No version issues with java. I don't want to change the users default java installation.I also would like the download to be as small as possible, part of the easy, easy approach.

I thought the java kernel installation would provide this. The small size was very attractive.

But the kernel is a public not a private jre. If I set an INSTALLDIR for the kernel jre installation and there is a jre elsewhere of the same version it will ignore my kernal install. Then my click and run commands don't work, because the jre is not where they expect it to be.

How do I get a private jre? Do I need to just brute force install the whole big shebang to a subdirectory of my installation? I'm unhappy about the download time due to the size.

Is there any way to use one of the small footprint jre installs for a private jre?
For my purposes there is no need to update registry entries for the jre.

I know some apps do bundle private jres. How do they do it? Are they massive downloads? I don't want to be massive - this is supposed to be a tantalizing free trial!!

Thanks much!! I've been doing a lot of head banging today and any input appreciated!!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sarobenalt
Offline
Joined: 2005-01-01
Points: 0

This is probably flame bait, but Eclipse RCP provides a way to bundle a private JRE. The standard distribution format provides a launcher application in the root folder and will honor a jre folder nested alongside the plugins and features folder. The bundled JRE will be used regardless of whether or not any other JRE is installed on the platform.

This has been a very handy feature when I needed to use a specific JRE version to match with an older WebLogic Server instance such that serialization would work correctly. Updating to the latest JRE would have been desirable, but Java 5 and later don't provide the required classes to support WLS 8.1 and upgrading the server was not an option in my case.

That being said, I'm not sure if RCP packaging is viable in your case since it will impose modularity constraints and has a different life cycle than standard Java programs, so as always, YMMV.

Steve Robenalt

cowwoc
Offline
Joined: 2003-08-24
Points: 0

If you have network access (and I assume you do, otherwise shipping the offline JRE installer wouldn't be an issue) then I recommend using the Java Kernel installer instead. Believe it or not, it'll be smaller than a private JRE and it'll automatically expand to a full JRE in a background thread.

Gili

minka99
Offline
Joined: 2008-03-27
Points: 0

I am using a kernel installer.

I don't like this solution because it changes the public installed jre for my free trial
example suite - that is not what a user would want.

My ideal would be a kernel installer that would install to a private jre, no registry
modification, etc.

BUT I don't see any way to make the kernel installer install a private jre.
(Btw - why doesn't sun implement this?)

cowwoc
Offline
Joined: 2003-08-24
Points: 0

> I am using a kernel installer.
>
> I don't like this solution because it changes the
> public installed jre for my free trial
> example suite - that is not what a user would want.

I don't sympathize with users unwilling to update the JRE. There is no good reason not to. Worse case scenario you could prompt users: "This application requires Java version X.Y. Do you wish to upgrade?" If they say "yes" you continue, otherwise abort.

> My ideal would be a kernel installer that would
> install to a private jre, no registry
> modification, etc.

Imagine what would happen if every Windows program installed its own version of DirectX, or if every video shipped its own version of Windows Media Player. Do you begin to understand why this logic is problematic? It makes no sense.

It's Sun's job to make sure that the JRE is backwards compatible or supports versioning (hopefully this will come in Java7). Beyond that users have no excuse to refuse to upgrade. I could be wrong but in my experience the people who refuse to upgrade are in the minority and it's not worth investing resources on them.

That being said, you could just install a public JRE, zip up its files and there you go: you have a private JRE. Just dump it into the same directory as your application and you're done. You can improve this process further by stripping out unused files...

samkass
Offline
Joined: 2004-09-22
Points: 0

cowwoc, what the poster is asking for is really not that unusual or weird. Java is not comparable to DirectX... it uses DirectX. Java is a platform-neutral API that application developers can write to that abstracts (but calls through to) the underlying OS. It's just like WINE from an app developer's point of view, and bundling a runtime should be no big deal (just like many games for the Mac these days ship with the WINE libraries).

Hopefully with JDK7's modularity one could bundle minimal runtimes and not have to trust a master repository of available Java runtimes.

In the meantime, here's a site that gives a good rundown on how to make things simple for your users despite the fact that you're developing in Java: http://www.excelsior-usa.com/articles/java-to-exe.html . About halfway down is a description and list of tools that will even generate an .exe for your Windows users. Although if possible I'd recommend the WebStart route.

jstansel
Offline
Joined: 2007-04-26
Points: 0

I don't know all the answers, but some years ago I played around with the java -version: cmd-line option. It lets you specify the jvm version that your app requires (a number of options as to whether it's exact, minimum, etc.)

So I'd say if your JRE doesn't get installed because the same version is already on the system, you may be able to use this method to start your app.

Of course, it's most likely looking through the registry, and you could potentially do that yourself too. But I thought this might save you the trouble.

Like I said, probably doesn't get you everything you need, but maybe will help a little.

-james.