Minimal JOGL

Hi folks,

I’m trying to make an applet that uses JOGL.
The key requirement for this applet is that it
must be small. So I’m wondering what ways
there are to make JOGL as small as possible.
Webstart is -not- an option because I need
to have it running in the browser page.

For Windows, the native libraries are small
enough (56KB for 1.1b10) so that’s OK to
be bundled with the applet. The main concern
is jogl.jar, which is 1086KB now. I believe it
has grown since b07 partly due to the Java
port of GLU. Since the applet will be using a
very small set of the whole API, what are the
ways to get jogl.jar down to, say 100KB?

Many thanks in advance!

.rex

You could try the Pack/Unpack APIs in java.util.jar.Pack200 in JDK 1.5. They provide huge compression ratios for jar files, much better than standard zip.

Aside from that you may be able to find tools out there (or write your own) to find dependencies in a jar file and strip out unreferenced classes and/or methods. I think this may be a bit of a challenge for JOGL, though.

Do JOGL support Applets ?

// Tomas

Not directly in the distribution, but I think some people have gotten them to work by dropping the JOGL jar and native libraries into jre/lib/ext, perhaps by writing an installer. I recommend using Java Web Start instead.

Like I guessed then.

// Tomas

You want to bundle jogl with the applet? You have to have your users install jogl manually to their jre before they can run the applet, since I dont think there is a way to load external libraries like jogl in an applet.
Downloading an external lib sort of defeats the point of an applet of course… :frowning:
Why cant you use webstart?

// Gregof

Hi Ken, thanks for the suggestion. I used Pack200 and
these are my results:

C:\pack200 --repack jogl.jar

C:\pack200 --modification-time=latest --deflate-hint=“false” --strip-debug jogl.pack.gz jogl.jar

And jogl.jar went from 1070KB to 234KB. Nice!

.rex

Running it as an applet is part of the
product plan: to have the whole thing
experienced in the browser inside a
web page. Can Webstart do it in the
browser window and -not- as a separate
window?

OK, now I can get JOGL down to a
~300KB distribution (JAR + DLLs),
the problem now is to load native
DLLs in an applet without requiring
a pre-install step. Is it possible at
all? How about signed applets?

Again, Webstart is not an option :slight_smile:

.rex

[quote]Is it possible at
all? How about signed applets?
[/quote]
It’s possible, though not convenient. Take a look at this:

http://www.javaranch.com/newsletter/200310/NativeLibraryInstallTutorial.html

ps. If you haven’t already compressed your native libraries, you can use UPX for that:

http://upx.sourceforge.net/

Cheers