Solved

pack200.exe

Posted on 2004-04-02
23
866 Views
Last Modified: 2007-12-19
Dear Experts,

As per the following link, there are pack200.exe and unpack200.exe. I believe it is not available in JRE1.5 Beta.

http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/pack200.html#pack200_compression

Can we download it from somewhere? Because I want to compress my jars (built using jre1.4.2) and my application needs jre1.4.2.

I could not use jre1.5 beta since my application will work perfectly on jre1.4.2.

Is there any way to achieve this?

Thanks for your help.

regards,
MSKumar
0
Comment
Question by:mskumar_apk
  • 10
  • 6
  • 5
23 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10745491
download 1.5 and grab the exe's from the installation.
0
 

Author Comment

by:mskumar_apk
ID: 10746859
no. i could not find pack/unpack executables in j2re1.5 and j2sdk1.5. thats why the above question.

kindly help if any body knows what to do.
0
 
LVL 92

Expert Comment

by:objects
ID: 10747034
you sure?  According to the doco pack200 support is provided with tiger.
They may well not be exe's.

0
 

Author Comment

by:mskumar_apk
ID: 10747085
yeah. jre1.5 has pack200 class. but it does not have pack200.exe.

my application is built on jre1.4.2 and i cant use jre1.5 beta's rt.jar. (which means i can't bundler jre1.5.  in other words i cant use jre1.5 for installation and jre1.4.2 for running application).
what to do to get standalone pack200.exe. according to documentation they are saying pack200 and unpack are purely C++ programs which can be built standalone.

i am eagerly searching for the methodology.
0
 
LVL 92

Expert Comment

by:objects
ID: 10747189
> but it does not have pack200.exe

Who said it should?

> according to documentation they are saying pack200 and unpack are purely C++ programs which can be built standalone.

Where does it say that in the doco?
0
 

Author Comment

by:mskumar_apk
ID: 10747579
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 10753419
>> there are pack200.exe and unpack200.exe. I believe it is not available in JRE1.5 Beta.
did you download the SDK or you just downloaded the JRE? it should be in the 1.5 SDK.
0
 

Author Comment

by:mskumar_apk
ID: 10754885
no in jdk also i could not fine any pack200.exe and unpack200.exe. jre contains pack200 class using which u can pack the jars that are built on jre1.5.

actually i have downloaded linux .bin jdk file.

since i want to use pack200 for jre1.4.2 based jars, i could not do that. in fact jre1.5 has unpack.exe ( i found it from the output of execution of .bin file) which is merely deleted after the installation by java installation kit.

0
 
LVL 14

Expert Comment

by:kennethxu
ID: 10758646
>> actually i have downloaded linux .bin jdk file.
if you need the .exe (which is for windows platform), you MUST download the window version of jdk and install, from there you'll find the pack200.exe file.
HTH
0
 
LVL 92

Expert Comment

by:objects
ID: 10761243
> you MUST download the window version of jdk and install

why is pack200 only available on Windows?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 14

Expert Comment

by:kennethxu
ID: 10761328
>> why is pack200 only available on Windows?
do you think pack200.exe is useful in any platform other then windows? as you always said to others, read the question and read the thread. :-)
0
 
LVL 92

Expert Comment

by:objects
ID: 10761387
I know what the question is asking. I didn't ask about pack200.exe, I was interested to know why you feel pack200 is only available on Windows?

> from there you'll find the pack200.exe file.

where exactly?
0
 
LVL 92

Expert Comment

by:objects
ID: 10761395
Try looking in the jre for Windows instead of the jdk (it maybe there, it may not).
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 10761425
>> I was interested to know why you feel pack200 is only available on Windows?
where of comment I said that, why you *always* make up something that others never committed?

>> I didn't ask about pack200.exe
It does no matter whether you ask for it. it is important that mskumar_apk asked for it!!
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 10761458
>> Try looking in the jre for Windows instead of the jdk (it maybe there, it may not).
what a joke! the jdk is the superset of jre. which means jdk includes everything jre has! don't tell me you don't know that objects.
0
 
LVL 92

Expert Comment

by:objects
ID: 10761480
> the jdk is the superset of jre.

That is not correct.

0
 
LVL 92

Expert Comment

by:objects
ID: 10761503
> where of comment I said that, why you *always* make up something that others never committed?

Its a simple q, as I was curious to why pack200 apparently is not made avaiulable under linux as you stated it was available under windows and was curious why and whether it wasn't available to other os's also.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 10761565
>> That is not correct.
did you ever downloaded jdk1.5 and had a look, if yes, then why it is not correct?
0
 

Author Comment

by:mskumar_apk
ID: 10763232
hello all,

cool and sorry for that confusion.

i am looking for pack200 executable (is it ok) for linux, windows and solaris.

I have downloaded j2sdk and j2re1.5 for linux, and looked for pack200 linux executable and could not find that. if j2sdk/j2re 1.5 for linux contains pack200 executable then windows j2sdk/j2re1.5 must have that pack200.exe right.

regards
MSKumar
0
 
LVL 92

Expert Comment

by:objects
ID: 10771514
Seems kennethxu doesn't want to answer your question either :(
I suspect that Sun may have just not got around to (or overlooked) including pack200 in this initial beta release of the SDK, perhaps kennethxu can answer our questions above.
0
 
LVL 92

Accepted Solution

by:
objects earned 125 total points
ID: 10771517
Failing locating it, here is some code that may help you:

import java.io.*;
  import java.util.*;
  import java.util.jar.*;

  import javax.pack.Pack200;

  public class TestPack {

    public static void main( String[] args) throws IOException {
      Pack200 p200 = new Pack200();
      Map p = p200.getProperties();
      p.put(Pack200.PACK_EFFORT, "7");
      p.put(Pack200.PACK_SEGMENT_LIMIT, "-1");
      p.put(Pack200.PACK_KEEP_FILE_ORDER, Pack200.FALSE);
      p.put(Pack200.PACK_MODIFICATION_TIME, Pack200.LATEST);
      p.put(Pack200.PACK_DEFLATE_HINT, Pack200.FALSE);
      p.put(Pack200.PACK_STRIP_DEBUG, Pack200.FALSE);
      p.put(Pack200.PACK_UNKNOWN_ATTRIBUTE, Pack200.ERROR);

      // pack
      JarFile jarFile = new JarFile( args[ 0]);
      FileOutputStream fos = new FileOutputStream( args[ 1]);
      p200.pack(jarFile, fos);
 
      // unpack
      File f = new File( args[ 1]);
      FileOutputStream fostream = new FileOutputStream( args[ 2]);
      JarOutputStream jostream = new JarOutputStream(fostream);
      p200.unpack(f, jostream);
      jostream.close();
    }
  }
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now