shrink jogl.jar

Hi,

I’d like to shrink my jogl.jar with something like proguard or JShrink.
The jogl.jar is quite big, it weights 1mb which is not nice for a
web applet. Has anybody ever successfully shrinked the jogl.jar?
Is it worth it?

Regards,

Toni

I just thought I’d give it a go, but only managed to get it down from 1.01MB to 0.98MB… darn.
I guess you could always remove the classes that you don’t need and recreate the JAR from that (or similarly, recompile only the classes you do need so as to keep the number of files to a minimum, and compress those).

Mh… good suggestion.
I just tried to compile jogl from scratch in eclipse but I just
fail to build the whole thing. I impot the project as ant project
but I get unresoved imports to

import com.sun.opengl.impl.;
import com.sun.gluegen.runtime.
;

Before I dig into this too deeply, is it possible to
compile jogkl in eclipse in the first place?

Regards,

Toni

Anyway… I tried to build jogl with ant but I get lots of errors, I
just paste the first two here:

generate.c.grammar.glib:
[javac] Compiling 12 source files to C:\Documents and Settings\bleile\Desktop\gluegen\build\classes
[javac] C:\Documents and Settings\bleile\Desktop\gluegen\build\gensrc\java\com\sun\gluegen\cgram\GnuCEmitter.java:272: cannot find symbol
[javac] symbol : method getNextSibling()
[javac] location: class com.sun.gluegen.cgram.TNode
[javac] if ( t.getNextSibling() != null ) {
[javac] ^
[javac] C:\Documents and Settings\bleile\Desktop\gluegen\build\gensrc\java\com\sun\gluegen\cgram\GnuCEmitter.java:286: cannot find symbol
[javac] symbol : method printTree(antlr.collections.AST)
[javac] location: class com.sun.gluegen.cgram.TNode
[javac] TNode.printTree( ex.node );

I’m using jdk 1.6.0 latest source tarball. Unfortunately I have no clue what’s
wrong, so any help is appreciated!

Cheers,

Toni

You might be trying to build with ANTLR 3; I’ve received reports that GlueGen doesn’t work with this version. If so, try ANTLR 2.7.7. I guarantee that the current JOGL / GlueGen source trees build with the appropriate tools.

The easiest way to shrink jogl.jar for JDK 5 users (and later) is to use Pack200 compression. jogl.jar compresses to ~275K with no changes. We host a jogl.jar.pack.gz on our download.java.net server alongside the jogl.jar.

The reason jogl.jar is so big is that we support all of the OpenGL extensions. The sheer number of methods generated into class GL is the reason for the large jar size. Simply eliminating individual classes like DebugGL and TraceGL won’t save much space. You could put IgnoreExtension directives into jogl/make/gl-common.cfg to disable code generation for those extensions you don’t need in your app, and bundle a custom version of JOGL. (This wouldn’t be a compliant JSR-231 implementation, but as long as you don’t use it outside your application that should be fine.)

Hi,

indeed, using the pack200 with the jnlp applet launcher speeds up thingss! But there’s
an issue with the noddraw.check!! I set it to true and silent but I always get the popup, and
after confirming with “yes” I also get an error message “unable to open propertie files”.
All this happens also with the gears sample on the jogl home page. Any workarounds for that?

Regards,

Toni

P.S.: I succeeded to compile jogl on another machine and stripped away some methods
without loosing much weight :frowning:

What OS are you on? What is the complete error message?

Open a bug against the JNLPAppletLauncher using the issue tracker here. If nobody else gets to it before then, I’ll look into it next week.

ok, posted a new issue:

https://applet-launcher.dev.java.net/issues/show_bug.cgi?id=1

This has been fixed by making this particular failure silent. This portion of the JNLPAppletLauncher is basically a hack and a better solution is forthcoming in the Java Plug-In.

the price I pay are crashing VM’s… :frowning:
When will this new plugin be available?

It is my primary project at Sun and I am aiming for release to the general public as soon as possible. Still multiple months out at the earliest though.