Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDK based Pack200 works but not Ant Pack200 Tasks

843802Nov 20 2007
Hi,

In My project, I was earlier using JDK Toolkit based Pack200 Utility and It was working fine for me. As each time user has to set JDK Bin path (C:\Program Files\Java\jdk1.6.0_02\bin) in System variables to run batch file so I switched to Ant based tasks through (https://java-pack200-ant-task.dev.java.net/ ) for Pack200 but it does not work fine.

I came across Following Issues.

#1. I have around 60 Jar files which earlier I was Repacking / packing through Batch file with Jdk based Pack200 support and it worked fine

Repack:
pack200 repack segment-limit=-1 %(JarFileLocation)\(FileName)

Pack:
pack200 --segment-limit=-1 %(JarFileLocation)\ FileName.pack.gz %(JarFileLocation)\(FileName)


#2. Now I switched to Ant Based Pack200 tasks and used following targets. Repacking goes fine but
At time of Packing, I am getting Exception. �java.lang.SecurityException: SHA digest error�.

I experimented with adding some of Attributes like Effort=1 or 0 but it does not work.
There is no difference what I was doing earlier with Jdk based Pack200 and now with Ant based
Pack200 tasks then why I am getting Exception and how it can be eliminated?


<target name="p200">
<taskdef name="pack200"
classname="com.sun.tools.apache.ant.pack200.Pack200Task"
classpath="${library}/Pack200Task.jar"/>

<taskdef name="unpack200"
classname="com.sun.tools.apache.ant.pack200.Unpack200Task"
classpath="${library}/Pack200Task.jar"/>
</target>

Repack:
<target name="RepackFile" depends="p200">
<pack200 src="${fileId}"
destfile="${fileId}${.pack}"
repack="Yes"
segmentlimit="-1"
/>

</target>

Pack:
<target name="PackFile" depends="p200">

<pack200 src="${fileId}"
destfile="${fileId}${.pack.gz }"
gzipoutput="yes"
segmentlimit="${segmentlimit}"
/>

</target>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2007
Added on Nov 20 2007
0 comments
349 views