Distributable libraries?

S

Steve Sobol

Is there a set of distributable libraries I can package with my Java
application that will allow it to run, instead of requiring people to install a
JVM? (Much like you can distribute the Visual Basic runtime DLL to allow people
to use your compiled VB app)

I'm thinking perhaps jvm.dll or libjvm.so along with a handful of other
libraries - can this be done? Does Sun approve of doing something like this?
 
C

Chris Smith

Steve said:
Is there a set of distributable libraries I can package with my Java
application that will allow it to run, instead of requiring people to install a
JVM? (Much like you can distribute the Visual Basic runtime DLL to allow people
to use your compiled VB app)

I'm thinking perhaps jvm.dll or libjvm.so along with a handful of other
libraries - can this be done? Does Sun approve of doing something like this?

The JRE is redistributable, and there is a README.TXT file in the JRE
listing those pieces that can be excluded. The remaining pieces must be
redistributed as a part of the complete JRE. You are not required to
run the JRE installer, and the JRE will work without the installer
having been run.

If it's important to you, though, that the files be only ".dll" or
".so" files, then you're out of luck.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
S

Steve Sobol

Chris said:
The JRE is redistributable, and there is a README.TXT file in the JRE
listing those pieces that can be excluded. The remaining pieces must be
redistributed as a part of the complete JRE. You are not required to
run the JRE installer, and the JRE will work without the installer
having been run.

If it's important to you, though, that the files be only ".dll" or
".so" files, then you're out of luck.

No... I just really would prefer not to have to distribute the command-line
executables and some other unecessary stuff; this is a project where I'd build
an executable that loaded the JVM and app using the Invocation API, and I don't
want to have to bundle 10-15 MB worth of extra stuff with the app. I'll check
the README - thank you.
 
S

Steve Sobol

Steve said:
No... I just really would prefer not to have to distribute the
command-line executables and some other unecessary stuff; this is a
project where I'd build an executable that loaded the JVM and app using
the Invocation API, and I don't want to have to bundle 10-15 MB worth of
extra stuff with the app. I'll check the README - thank you.

Ack. The *entire* 1.4.2 JRE is 40MB. And there are only a few items that Sun
says are optional.

*shudder*
 
M

Mark Thornton

Steve said:
No... I just really would prefer not to have to distribute the
command-line executables and some other unecessary stuff; this is a
project where I'd build an executable that loaded the JVM and app using
the Invocation API, and I don't want to have to bundle 10-15 MB worth of
extra stuff with the app. I'll check the README - thank you.

The command line executables are only just over 1MB (unpacked) in total
for 1.5, so there isn't really a lot to be saved there. The big items
are in the lib directory.

Mark Thornton
 
C

Chris Smith

Steve said:
Ack. The *entire* 1.4.2 JRE is 40MB. And there are only a few items that Sun
says are optional.

Make sure that (unless you need otherwise) you're getting the Windows-
only version. MindIQ distributes an application with the 1.4.2 JRE, and
the entire resulting file is about 30 MB in size; the JRE is probably
about 67% of that.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
E

Eric Sosman

Steve said:
Ack. The *entire* 1.4.2 JRE is 40MB. And there are only a few items that Sun
says are optional.

What are you measuring (or, how are you measuring it)?
From the download page for 1.4.2_06, the download sizes are

Windows 14.96 MB
Linux 13.24
Solaris SPARC 14.08 (+ 4.47 for 64-bit)
Solaris x86 12.48

None of these is anywhere near 40MB, and the total of all
four (five) is 54.76 (59.23), also not convincingly close
to 40MB.

(Disclaimer: Just because I'm writing about Sun stuff
from a sun.com address, don't assume I speak for Sun.
"The Secretary will disavow all knowledge," as 'tis said.)
 
A

Andrew Thompson

What are you measuring (or, how are you measuring it)?
From the download page for 1.4.2_06, the download sizes are

Windows 14.96 MB

That reminds me. The download comes zipped and compressed,
rt.jar on the file system is zipped but uncompressed.

HTH
 
S

Steve Sobol

Eric said:
What are you measuring (or, how are you measuring it)?

Mmmm, I'm not sure why my program directory (c:\program
files\java\j2re1.4.2_03) has 40MB of stuff in it. I did, in fact, download the
Windows 1.4.2_06 JRE just earlier today and it is only 15MB.

rt.jar (in this installation) counts for about 25MB of that 40MB total.
 
S

Steve Sobol

Steve said:
rt.jar (in this installation) counts for about 25MB of that 40MB total.

OK, so the reason is that it is stored uncompressed.

Can I unarchive it and re-archive it using Winzip on its "maximum compression"
setting? Will this cause any problems other than slower access to rt.jar?

Or, another solution:

I created a blank ZIP file using Winzip, and using maximum compression, and put
a copy of rt.jar into it. The ZIP ends up being about 6MB. How about setting up
an installer that unzips rt.jar at install time?
 
E

Eric Sosman

Steve said:
OK, so the reason is that it is stored uncompressed.

Can I unarchive it and re-archive it using Winzip on its "maximum compression"
setting? Will this cause any problems other than slower access to rt.jar?

As an old boss of mine used to say, "I'd bet your
life on it." In other words, I don't know. There might
(or might not) be a chicken-and-egg problem, something
like the JVM needing some rt.jar-resident classes to
decompress compressed JAR members, that sort of thing.
Why not try it and see?
Or, another solution:

I created a blank ZIP file using Winzip, and using maximum compression, and put
a copy of rt.jar into it. The ZIP ends up being about 6MB. How about setting up
an installer that unzips rt.jar at install time?

You must distribute all the required pieces of the
JRE, but as far as I can tell it's not required that you
distribute them in the same formats Sun uses. That is, I
don't think there's anything preventing you from using
your own installer, your own compression techniques, and
your own Black Magic (tm), so long as the target system
gets all the required bits. IANAL, though, so you might
want to investigate further before sinking a lot of work
into this approach.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top