Pack200

Disclaimer: I am not an official or a manager for the 4K Competition. The statements contained herein are my opinion or the (possibly mis)quoted opinions of other forum members.

There’s been some discussion about the legality of using Pack200 as a mechanism to save space. We all know that the official list of rules has one item that clearly and unambiguously states “No Pack200”, In addition, the forum topic Important: NO PACK200 states that this restriction is due to the fact that that not all members will be able to either find a webhost that supports Pack200 or be able to configure their own webhost to support Pack200, and that allowing it might give those members who have a suitable webhost an unfair advantage. The specific wording is:

Forum members oNyx and appel, as well as myself, have both pointed at the official list of rules as a clear and firm prohibition of Pack200 regardless of the reasons for the prohibition.

Forum members and contributors moogie and Riven have both made the argument that there is a way in which Pack200 can be employed that does not require a webhost, and that this configuration should be allowed since it offers the benefits to all contributors and gives no unfair advantage.

All sides have expressed an interest in having an official opinion and/or ruling on the issue, but that has yet to happen.

My opinion: The rules as stated today clearly prohibit any and all use of Pack200. However, I would be happy to see this rule change to allow server-less configurations, provided that moogie and/or Riven make public the process of preparing the Pack200 archive. If the official ruling is that the rules as they stand today do not prohibit a server-less Pack200 configuration, I believe the rules need to be clarified.

What about you? Do you think that the rules as they stand today allow this server-less Pack200 configuration? If not, do you think that the rules should be changed to allow this configuration?

Of course, the final decision will have to come from the contest manager(s), but if we all voice our opinion here then maybe the decision they come to will be the one the majority are happy with.

note: I did not read the entire post above, pretty much just the title

i already PMed moogie about this not too long ago. Don’t forget there is a rule saying you can provide a JAR as long as it is self-executable. This by itself rules out any serverside pack200, as the jar is already downloaded. Anyway, if a standalone jar is self executable, I don’t care if it uses pack200 internally or whatever. I’ll update the wording sometime, sorry for any confusion

I disallowed serverside pack200 because such resources are not widely available to everyone like the SDK is.

Thank you for responding.

While I disagree that the rule you refer to implicitly allows Pack200 in self-executable jars, I am more than willing to accept a rule change that does explicitly allow Pack200 to be used in self-executable jars.

I would suggest that the “Important: NO PACK200” thread be either deleted or re-written in addition to the rule change so as not to cause more confusion…

moogie, would you be so kind as to post your technique for preparing a Pack200 self-executable jar? Thanks in advance.

I am currently in the process of extending the 4KJO tool to automatically produce a pack200 embedded self executing JAR. It is a bit more complex and i am afraid that it will be less stable and more brittle… but for the interum here are the manual steps:

-make sure your class is called “aichess4k.class” (this will change with the automated version)
-remove your main method from your class making sure that the contructor is your entry point.
-make a class which has a main method that calls your class’s constructor
-put these two classes into a JAR
-run the 4KJO tool on this JAR to try and get the smallest JAR (using FourKJO.class)
-remove the class with the main class from this optimised JAR
-run the pack200 generator on this class by runnning "java Process
-use append.java to append the output pack200 file to the loader “loader.class”: java appender “loader.class”

Notes
-you may need to edit the appender.java to change the path to WinZip executable.
-You will have to include the JARs included in the class path.
-The program assumes that the current working directory is where the program is located.

And theoretically you should have a working executable JAR :slight_smile:

I wil upload the files shortly.

http://www.filehosting.cc/file/20248/4kjo-zip.html

I have made a tool which will create the embedded pack200 self executing JAR…

Bewarned that I have not tested it riguorsly and it is quite a hack:

http://www.java-gaming.org/forums/index.php?topic=15497.msg124708#msg124708