Results 1 to 2 of 2
  1. #1
    surbhit4u is offline Member
    Join Date
    Sep 2010
    Posts
    1
    Rep Power
    0

    Default How to Unjar a JAR file without JDK and without winzip/winrar ??

    Hi All,

    For one of business scenario, I want to un Jar a JAR file.
    The challenge here is it should happen without using JDK.
    Also, the unjar should happen without winzip/winrar.
    I only have JRE installed on that system (windows).


    Is there any way, I can do it.
    Its a client requirement & I am stuck.. DOn't know how to do this ??

    Need help from you guys...

    Thanks in advance...

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    well, i guess you could make a utility "extractor.jar", which would make use of the java.util.jar API. where you create a JarFile object to open the file and programatically iterate thru the contents of the jar file and write them to the file system, creating folder structure as required. So basically, you would create a java utility, using Java API available in a JRE, to perform the function of the "jar' command line tool.

    Bonus points for making this utility inside the jar file itself, e.g. a self-extracting jar file. Where the code to extract a jar file is also inside the jar file you want to extract and is made an executable jar file with the entry in the manifest.

    Though depending on what you need or are trying to do, there are existing "installer" packages that work to create a bundled self-executable jar file installer or extractor file. For example, IzPack, Mini Installer, Ant Installer. See also: Open Source Installers Generators in Java.

Similar Threads

  1. Replies: 1
    Last Post: 08-04-2010, 03:24 PM
  2. Replies: 0
    Last Post: 07-15-2010, 01:23 PM
  3. Replies: 8
    Last Post: 02-18-2010, 12:54 PM
  4. Replies: 0
    Last Post: 02-11-2009, 09:53 AM
  5. Replies: 7
    Last Post: 05-23-2008, 03:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •