Solved

pack200.exe

Posted on 2004-04-02
23
873 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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
 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jboss 7.1 start up error 1 83
dao vs facade design patterns 2 71
How to fix  socket closed error 11 64
Session in java desktop 5 38
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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 learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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…
Suggested Courses

739 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