permaculture playing cards*
The moose likes Java in General and the fly likes How to reduce the size of j2sdk? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to reduce the size of j2sdk?" Watch "How to reduce the size of j2sdk?" New topic
Author

How to reduce the size of j2sdk?

Chris Chen
Greenhorn

Joined: Jul 20, 2001
Posts: 11
I have finished an application under tomcat, and I just want it published with j2sdk in a single package.
But, you know, the j2sdk is rather too big to ship. I suppose the j2sdk maybe can be simpled just carrying some .dll files and some .jar packages plus some configure files etc. I say, I'm not just using jre, 'cause I have to have some extra thing included.
Did anyone here have some methods/experiments to reduce it?
Thanks, //bow.
[ February 19, 2004: Message edited by: Chris Chen ]

Chris Chen<br />From Beijing,China
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I say, I'm not just using jre, 'cause I have to have some extra thing included.
What extra things do you need? You may be able to identify specific jar files to add to the JRE.


"I'm not back." - Bill Harding, Twister
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Yes - what extra thing is this?
The compiler?
It is usable from inside the jre, as far as I know.
To ship the j2sdk is prohibited - you know?
What can you cut off:
J2SDK - JRE = JDIFF
JDIFF - NEEDED = OFFCUT
J2SDK - OFFCUT = WHAT_YOU_WANT.
As long as you keep the things secret, you need, we can only guess.
The docs.
Parts of the rt.lib (Would you like to sort single packages out?)
Do you need jar, javaw, javadoc, native2ascii, jarsigner?
There are other, seldom used libs too.
Can't you define it the other way round: Shipping the jre plus something?


http://home.arcor.de/hirnstrom/bewerbung
Chris Chen
Greenhorn

Joined: Jul 20, 2001
Posts: 11
Thanks very much. //bow
Things looks fine now. I really do not need the full jdk, I have supposed that the tomcat server should have jdk installed. Having try it, I know I just need the jre, adding some .jar files.
Now, here's the other question:
Is it prohibited to ship the jre?
Maarten Vergouwen
Ranch Hand

Joined: Jan 12, 2004
Posts: 60
Doesnt the full sdk also include NetBeans?
Removing that would save a lot of space I think.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
The full J2SDK 1.4.2 for Win32 is roughly 43.5MB. - edit - this is the version without Netbeans, Netbeans cobundled version is 92.5MB.
The JRE 1.4.2 comes to 14.5MB.
Hardly too much to distribute, given the size of your complete product if that includes Tomcat and assorted libraries as well as your own code (as for all that you'd likely need a CD anyhow giving ample space).
DO make sure you have permission from Sun to redistribute, as there are limitations.
From the J2SDK 1.4.2_03 license:

License to Distribute Software. Subject to the terms and conditions of this Agreement, including, but not limited to the Java Technology Restrictions of these Supplemental Terms, Sun grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute the Software, provided that (i) you distribute the Software complete and unmodified (unless otherwise specified in the applicable README file) and only bundled as part of, and for the sole purpose of running, your Programs, (ii) the Programs add significant and primary functionality to the Software, (iii) you do not distribute additional software intended to replace any component(s) of the Software (unless otherwise specified in the applicable README file), (iv) you do not remove or alter any proprietary legends or notices contained in the Software, (v) you only distribute the Software subject to a license agreement that protects Sun's interests consistent with the terms contained in this Agreement, and (vi) you agree to defend and indemnify Sun and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software.

Check especially the parts I marked in bold.
You may specifically NOT remove parts of the distribution to cut it down in size, but you may redistribute the J2SDK as a whole entity if it is required to run your application (Sun ain't stupid, they want people to have it whether through them direct or otherwise after all, but they do want everyone to have a complete version)!
Mind that you have to distribute the installer which you can of course call from your own installer.
[ February 20, 2004: Message edited by: Jeroen Wenting ]

42
Chris Chen
Greenhorn

Joined: Jul 20, 2001
Posts: 11
Many thanks to all.
Jeroen Wenting´┐Żs reply remind me to read the license of jre.
That's what I want to see:

License to Distribute Software. Subject to the terms
and conditions of this Agreement, including, but not limited
to Section 4 (Java Technology Restrictions) of these
Supplemental Terms, Sun grants you a non-exclusive,
non-transferable, limited license to reproduce and
distribute the Software, provided that (i) you distribute
the Software complete and unmodified (unless otherwise
specified in the applicable README file) and only bundled as
part of, and for the sole purpose of running, your Programs,
(ii) the Programs add significant and primary functionality
to the Software, (iii) you do not distribute additional
software intended to replace any component(s) of the
Software (unless otherwise specified in the applicable
README file), (iv) you do not remove or alter any
proprietary legends or notices contained in the Software,
(v) you only distribute the Software subject to a license
agreement that protects Sun's interests consistent with the
terms contained in this Agreement, and (vi) you agree to
defend and indemnify Sun and its licensors from and against
any damages, costs, liabilities, settlement amounts and/or
expenses (including attorneys' fees) incurred in connection
with any claim, lawsuit or action by any third party that
arises or results from the use or distribution of any and
all Programs and/or Software. (vi) include the following
statement as part of product documentation (whether hard
copy or electronic), as a part of a copyright page or
proprietary rights notice page, in an "About" box or in any
other form reasonably designed to make the statement visible
to users of the Software: "This product includes code
licensed from RSA Security, Inc.", and (vii) include the
statement, "Some portions licensed from IBM are available at
http://oss.software.ibm.com/icu4j/".

[ February 20, 2004: Message edited by: Chris Chen ]
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Are you sure about j2sdk?
As far as I know, you may distribute the JRE, but not the J2SDK this way.
That's enough to ship your applications, but gives SUN the possibility to count the developer-downloads.
As a special note:
When downloading the j2sdk-1.4.2-beta-xy, it was even prohibited to ship this beta-JRE. I guess to avoid customers complaining about beta-errors.
I have never found a magazine, which included the newest J2SDK, so that makes me even more sure, that you may NOT ship a J2SDK.
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Since you appear to have duplicated part of the JRE when you quoted the accompanying licence, it appears you are now in violation of that licence, since you did not post the entire JRE with it.


Tony Morris
Java Q&A (FAQ, Trivia)
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Stefan, my quote is from the J2SDK license. For betas things are different of course, after all they're experimental releases.
Tony, quoting parts of textfiles in a context like this is covered under "fair use". Cracking open a software distribution and distributing only parts which together make up a somewhat functional whole is not.
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
I don't see a "fair use" section !?
Chris Chen
Greenhorn

Joined: Jul 20, 2001
Posts: 11
Thank you all.
Well, I have distributed the entire JRE. Is it still violation of that licence?
Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
Originally posted by Tony Morris:
I don't see a "fair use" section !?

"Fair use" refers to copyright laws.
 
Consider Paul's rocket mass heater.
 
subject: How to reduce the size of j2sdk?
 
Similar Threads
About publishing an application under tomcat
Need some help urgently...
Commands n procedure RedHat9.0
Setting PATH env value in Ant 1.4.1
while running junit it is throwing java.lang.Unsupported Class Version Error