Impossible to read rt.jar classes??

Hi,
I noticed that recent versions of the rt.jar from Sun are compressed in a way making it impossible to extract files from it?
I need to do this from a Java tool I am creating, but I end ut with a:
java.util.zip.ZipException: invalid CEN header format
And when trying to extract files using winzip I get a CRC error...
I suppose this is a way of protecting the holy rt.jar file from evil hackers or virus programs or something, but for me it is quite frustrating!
I really need to extract these files programatically, are there any workarounds? And, how was this extraction protection added in the first place?

Have you tried:
jar -xvf rt.jar
V.V.
Yes, that will extract the files even from those CRC-error rt.jar files, however I really need to do this in my own program directly on the rt.jar file, this is an important feature of the tool I am making, unfortunately.
It works on almost every JAR file, except the ones coming with the JRE, which are the most important ones. Even the JDK rt.jar seems fine, but that still does not help me as I cannot rely on any particular version of the rt.jar to be available on my users computer...

Similar Messages

  • Include rt.jar class files in my own jar file to run 1.2+ applets on MS JVM

    My problem is this. I'm writing an applet (which includes 1.2 classes) for my organization (over 2000 NT workstations) in which no one has administrative privelages to install Sun's JRE 1.2 or greater. The target browser is IE 5. Our NT admins are having problems pushing the JRE out so my only two options are to rewrite everything as 1.1 or somehow include the missing class files from rt.jar.
    I really do not want to rewrite it all!
    I was able to extract the missing class files (i.e. /java/util/HashMap.class) but I cannot figure out how to get the IE JVM to use them. Things I have tried:
    1. jarred up all my class files along with the missing classes from rt.jar.
    $ jar cvf test.jar *.class java
    added manifest
    adding: ArrayObj.class(in = 731) (out= 448)(deflated 38%)
    adding: DivMonGrid.class(in = 1509) (out= 812)(deflated 46%)
    adding: GridLayout2.class(in = 2720) (out= 1514)(deflated 44%)
    adding: Item.class(in = 317) (out= 232)(deflated 26%)
    adding: Row.class(in = 588) (out= 365)(deflated 37%)
    adding: Screen.class(in = 672) (out= 416)(deflated 38%)
    adding: Site.class(in = 545) (out= 360)(deflated 33%)
    adding: divmonDash.class(in = 12506) (out= 6892)(deflated 44%)
    adding: java/(in = 0) (out= 0)(stored 0%)
    adding: java/util/(in = 0) (out= 0)(stored 0%)
    adding: java/util/HashMap.class(in = 6668) (out= 3461)(deflated 48%)
    adding: java/util/HashMap$1.class(in = 931) (out= 513)(deflated 44%)
    adding: java/util/HashMap$2.class(in = 800) (out= 454)(deflated 43%)
    adding: java/util/HashMap$3.class(in = 1608) (out= 904)(deflated 43%)
    adding: java/util/HashMap$EmptyHashIterator.class(in = 592) (out= 358)(deflated 39%)
    adding: java/util/HashMap$Entry.class(in = 1505) (out= 775)(deflated 48%)
    adding: java/util/HashMap$HashIterator.class(in = 1814) (out= 1096)(deflated 39%)
    $ jar -tf test.jar
    META-INF/
    META-INF/MANIFEST.MF
    ArrayObj.class
    DivMonGrid.class
    GridLayout2.class
    Item.class
    Row.class
    Screen.class
    Site.class
    divmonDash.class
    java/
    java/util/
    java/util/HashMap.class
    java/util/HashMap$1.class
    java/util/HashMap$2.class
    java/util/HashMap$3.class
    java/util/HashMap$EmptyHashIterator.class
    java/util/HashMap$Entry.class
    java/util/HashMap$HashIterator.class
    RESULT: IE JVM complains classnotfoundexception (its complaining about not finding HashMap.class)
    2. Tried to just place missing *.class files in same directory as my class files
    RESULT: Compiler error (complaining about file not be in correct path package) I understand this because when it was created the package statement has the class file in java/util/.
    If anyone has done this before or knows how to do it, please help me out.
    Thanks!

    When the collection classes first came out, I think they were available in a separate jar (although the package name may be slightly different). If it's just collection classes, that might be worthwhile looking at.
    The MS JVM may be spewing because the class format is too new; you may try with rt.jar classes from an older JVM (such as JDK 1.2), or try to recompile them from source using -target 1.1.

  • Problem reading a jar file ?!

    Hello,
    I am having a problem finding a class file which is inside a jar(xercesImpl.jar) which is in the classpath. I cant figure out what the problem.
    I suspect it could be because my JVM is not reading the jar correctly.
    When i click on a jar, a dialog box titled "java virtual machine launcher" saying "failed to load main-class manifest attribute .." is displayed.
    Is it that there are executable and non-executable jars, and JVM will execute only the former ones ?
    Or Does this mean somethign is wrong with my JRE/JVM??
    i also tried typing "jar t xercesImpl.jar" (to see if it can print the table of files) and it doesnt do anything, doesnt even return to the prompt.
    I am on win xp and few days back downloaded jdk1.5.0 and uninstalled previous jdk.
    it seems windows has its own jre. i am bit confused which is being used.
    i m a Java newbie, so please forgive my ignorance. Any help appreciated.
    Thank you.

    Hello,
    Well seems you are going through the horror of creating application jar file from command prompt. I went through the same and finally decided to make it through jBuilder. But the trouble persisted and I was getting same error as you were getting till I explicitly specified all the third party jar files I was using in the classpath and the problem was solved.
    I recommend you to explicitly set all the jars in classpath that are being used by your application. Also set the path of any resources if you have any.
    All the best.
    Hemanshu

  • Loading Jar classes dynamically - 10 Duke points

    How can I load a jar class dynamically if it relies on say other interface? Example is, if I have three classes read from the jar file, Test.class, Test1.class and Testable.class
    and "class Test implements Testable..."
    If I load the Test.class, how do I tell my own class loader that Testable class is along the way, instead of getting a java.lang.NoClassDefFoundError: Testable
    Need example source that works for this type of problem.
    Cheers
    Abraham Khalil

    protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {     
    name = name.replace('/', '.').replace('\\', '.');
    try { 
    // check if system class
    return findSystemClass(name);
    catch (ClassNotFoundException e) {}
    catch (NoClassDefFoundError e) {}
    // check if class already loaded
    Class cl = null;
    JarClassEntry jarEntry = (JarClassEntry) classes.get(name);
    if (jarEntry != null) { // new class not loaded
    // load class bytes--details depend on class loader
    byte[] classBytes = loadClassBytes(name);
    if (classBytes == null) {
    throw new ClassNotFoundException(name);
    String className = name;
    if (className.endsWith(".class")) {
    className = className.substring(0, className.indexOf(".class"));

  • I want to add event to the Icalendar threw caldav4j jar classes . Can I do that what would be the event request URL

    I want to add / retrieve event to the Icalendar threw caldav4j jar classes . Can I do that what would be the event request URL
    Retrieve Events :
    HttpClient http = new HttpClient();
        http.getState().setCredentials(new AuthScope("p06-caldav.icloud.com", 443,"https"), credentials);  
        http.getParams().setAuthenticationPreemptive(true);  
        HostConfiguration hostconfig = http.getHostConfiguration();
        hostconfig.setHost("p06-caldav.icloud.com");
        hostconfig.setHost("p06-caldav.icloud.com", 443, "https");
    CalendarCalDAVReportMethod method = factory1.createCalendarCalDAVReportMethod();
    method.setPath("/1809484432/calendars/");
      <C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
    <D:prop xmlns:D="DAV:">
    <D:getetag/>
    <D:allprop/>
    <C:calendar-data>
    <C:comp name="VCALENDAR">
    <C:comp name="VEVENT"/>
    </C:comp>
    </C:calendar-data>
    </D:prop>
    <C:filter>
    <C:comp-filter name="VCALENDAR"/>
    </C:filter>
    </C:calendar-query>
    But Iam getting bad request . Can any body help me out on this

    Still no luck...nor many helpful comments.
    THis is what the top of my iTunes U screen looks like when I am in my course. I cannot see anything on the right hand side to click on that takes me to an edit page.
    The following is taken from Penn State University related to drop boxes:
    None of the stuff they refer to is on my screen - neither this one or any others.
    Again, any help would be most appreciated.

  • I have a 2011 macbook pro, buy yet when I connect my 16GB or 8GB Sandisk Extreme class 10 30mb card, it wont read it, however, it reads a 2GB class 2 card, is there anyway to fix this?

    I have a 2011 macbook pro, buy yet when I connect my 16GB or 8GB Sandisk Extreme class 10 30mb card, it wont read it, however, it reads a 2GB class 2 card, is there anyway to fix this? and no, there is nothing wrong with the cards, they shoot fine, my dell inspiron 15 reads these cards fine, but yet my brand new macbook pro does not.

    After many days of frustration, I try a stupid thing.... Put the SD card in the Lock Position and... Voilá!
    The way I find to access the content is put the SD card in the Lock position..
    Cheers

  • How to import custom java jar/class into oracle to be used in java proc ?

    Hi
    I would like to know how to import custom java jar/class files into oracle to be used in java stored procedure.
    I am developing a oracle pl/sql procedure to call java program. The java program will be created as procedure and will be published.
    But, my question is that I do have a other external jar/class file that need to be imported into this java program.
    example
    raise_sal.java
    import java.util.*;
    import oracle.sql.*;
    <<reference other java programs >>
    import cmpmsgsvc.xxxx.* ;
    import cmpmsgsvc.yyyy.* ;
    import cmpmsgsvc.zzzz.* ;
    how do I import the cmpmsgsvc jar/class file into oracle so that I don't have any
    compilation errros on raise_sal.java program ??
    what are the steps to import/compile and validate to do this?
    thanks for your help in advance.
    Thanks
    rrb.

    Kuassi
    Problem is that, I have 6 jar files that are needed to be included in the main java program. And, there are more than 50+ classes, propertiers in those 6 jar files.
    It might be not good idea to have all those 50+ classes in the production database.
    Is there anyway that I keep all those 6 jar files in unix box (our's is oracle erp installation with oracle being installed on unix box) and just refer them in the main java program. I mean database will be loaded with main java program and it should able to refer other 6 jar files from unix.
    if we create a directory and keep all jar files in there and include that directory in classpath variable, does this works? or what is other method?
    Please let me know.
    Thanks

  • Reading & writing binaries(.class files)

    folks,
    how does one go about reading and writing .class files in java. I am able to write 'em only in ASCII format which is not what i want.
    Thanks!

    Did anybody say anything about disassembling?He wants to read and write class files, it's the title of the post.
    I don't appreciate you dismissing my suggestions like that.
    There's plenty of gotchas in reading and writing class files, such as Longs & Doubles taking up 2 positions in the constant pool.
    Hence the reason why I suggested using an open source library like BCEL or ASM. These are still valid as class readers, even if you don't touch the byte code. ( disassembly )
    But what would I know Ejp....sure I only wrote my own Java 1.5 class reader / disassembler.

  • Impossible to read video after a location rental of a film on itunes store

    It is Impossible to read video after a location rental of a film on itunes store
    I have tried re renting in itunes 
    I have rebooted my ipad
    What do i have to do ?

    Actually, you can. It's a bit of a hack, but nothing serious and it doesn't involve anything that would get your warranty revoked. What it entails is making a tweak to your iTunes Music Library.xml
    1) Make all the informational changes, ratings or whatever to the movie you want to keep on the Apple TV.
    2) Sync the movie to your Apple TV then shut down iTunes
    3) Make a backup of your iTunes Music Libary.xml
    4) Create a small m4v file for each movie you intend to delete from the computer you synced with the Apple TV. Give each file it's own unique name.
    5) Edit the iTunes Music Library.xml for each movie entry, pointing the entries to your tiny dummy m4v files
    6) Delete the original m4v for the movie
    If you open iTunes and sync up to your Apple TV you should notice that the original movie does not get overwritten with the dummy file. The only way the Apple TV will grab that file is if you update the information in your iTunes copy and/or the dates change for the movie record in the xml.
    As a side note to Apple: The fact we cannot leave content on our Apple TVs without this hack is uncharacteristic of your company. I paid for the hard drive, the movie and I have to use twice as much hard drive space on my network than I should? This is not environmentally sound nor is it consumer friendly.
    Enjoy!

  • Blue impossible to read

    Also posted in After Effects forum...
    Is anybody else finding the new blue on grey impossible to read?  A dark text colour on a dark background is such a fundamental error, how can it have passed QC?
    Lightening the background does nothing to improve the situation - because dark text on a light background is just as bad.
    Until this changes to a brighter colour, I am virtually unable to use AE and Pr!

    I personally am not having issues with the "blue" color with the exception of the CTI (Current Time Indicator) extending down through video tracks with the default Iris label color. Personally, I find it very hard to see.
    IMO the time code could be a little brighter like the borders around the panels when a panel is selected. When I saw the YouTube video preview that Dave Helmsley did on the new release of PP I immediately hated the blue. IMO the yellow trim on the dark gray really popped and was easy on the eyes. But after installing and experimenting with the new update 2014.1 I am finding I like the new enhanced interface with the blue color with the a fore mentioned exception of CTI on Iris labeled tracks.

  • Impossible to read digital New Yorker!

    does anyone else find it impossible to read the digital New Yorker on the iPad? If you try to move the page so that it is centered on the screen, it jumps right back to where it was. And parts of the magazine page are always off screen. Try to move it and it jumps right back. there must be some way to fix this, but I can't figure out how!

    Well, it more or less fills the screen in landscape, with a 2-page spread, but that's way too small to easily read the text. To read comfortably, you want to enlarge the page and move it around, like you do with the desktop (or laptop) computer. But when you try to do that with the iPad, it just snaps back.
    Do you really find that it's enjoyable to read when the entire spread is visible?

  • Impossible to read some engraved DVD on SD-R2212

    Hello,
    Impossible to read some engraved DVD with my cd/dvdrom sd-r2212.
    I did not find any information on this reader (Dvdr-R- or Dvd-R+)
    Where is the problem?
    Do I need a new driver ?
    Thanks

    Hi Daniel,
    Your CD/RW-DVDROM should be able to read DVD-ROM, DVD-RAM, DVD-R and DVD-RW formats. It is not compatible with the +R and +RW formats.
    If your problem is only with reading DVD-R or -RW disca then it is probably a compatability issue with the type of discs you are using. Not all blank media is compatible with all optical drives.
    regards,

  • Read/Write Jar files?

    This is really a newbie question, but since there's a forum specifically for jar questions I figured it was better to start here and move it to the newbie section if y'all deem it appropriate.
    I have written a desktop application using Java 1.4.1 class libraries and intend the application to run on multiple platforms including Mac OS X, Windows XP and Linux. The application works standalone (not yet jarred) on the machine it was developed on, but now it's time to begin figuring out the distribution method.
    Right now, the application reads several files from a flat text-file database, allows the user to peruse and display the information in a variety of ways, and gives the user a method to add to the flat-file database as needed. The file is about a megabyte and is excerpted into memory at initialization, then not referred to again unless the user writes additional data. When the user generates new data, write traffic to the file is fairly light, maybe 2-3kbytes per session.
    I searched the forums for the best way to handle read/write data files for distribution and so far I haven't found anything that seems relevant, but surely the question must have been asked and answered before - maybe I'm using the wrong keywords?
    Anyway, I have three basic questions:
    1) Can I both read and write a file that's enclosed in a jar file? Or are files read-only once "jarred"?
    2) Assuming I can both read and write a file within my jar file, is reading and rewriting within the jar so inefficient as to make that a non-preferred approach?
    3) How do other folks who have a local read/write datafile in a desktop application deal with distribution? Keep the read/write datafile within the jar? Make a copy of it outside the first time the application is run and always read/write the copy outside the jar? Or some other strategy?
    Thanks for any suggestions you can give a newbie at the Java game.
    Jon

    Thanks, that was pretty much what I suspected.
    I have several data files and configuration files for this project, so I was trying to make the distribution as clean as possible. At least some of the config information can be hidden in Preferences, but I was struggling with the data files. I'll include the data files in my jar, then unpack them to the user's directory when launched the first time and work with them thereafter in the user's directory.
    Enjoy the Dukes!
    Jon

  • Compiler is not recognizing MDM jar classes

    hi Experts,
                      I am trying to cretae  a java wrapper on top of MDM using Java API's. I created a simple java program and i was able to access the MDM repository. But when I created a Java DC I am getting the build errors in the same code.
    the steps I followed.
    1) added all the five jars in the java build path.
    2) cretaed a classpath variable which points to the location of the jar files in (window->preferences->java->classpathvariables)
    3) wrote a program which uses the classes mentiond in the jar files (without compilation errors)
    Now I build the program and build gets failed.
    The errors shown are
    package com.sap.mdm.data does not exist
    package com.sap.mdm.extension does not exist
    i.e whatever packages I have used in the programs are not recognized by the java compiler.
    Best Regards
    Pramod

    hi,
         I got the solution for above problem.
    DC's doesn't recognize added jars in the java build path. You have to add them in the external library and than expose these jars to the other DC by adding them in the public part of the external library DC.
    Enjoy.

  • Regarding reading a jar/war file

    Hi,
    I have to read a war file. below is the code...
    String Name;
    Name="D://work//webapp//meta-inf//MANIFEST.MF";
    InputStream is= null;
    JarInputStream jis = null;
    is = Class1.class.getClassLoader().getResourceAsStream(Name);
    if (getClass().getClassLoader() == null)
    is = ClassLoader.getSystemClassLoader().getSystemResourceAsStream( Name );
    jis = new JarInputStream(is );
    but the InputStream is as value as null, and nullpointerexception is returned.
    Any help would be great.
    Thanks

    user10196088 wrote:
    String Name;
    Name="D://work//webapp//meta-inf//MANIFEST.MF";For one, you don't need the double slashes when they're that way. A single slash would be enough.
    InputStream is= null;
    JarInputStream jis = null;
    is = Class1.class.getClassLoader().getResourceAsStream(Name);That's not how getResourceAsStream() works. You're giving it a full filesystem path. Read through the Javadoc.
    if (getClass().getClassLoader() == null)
    is = ClassLoader.getSystemClassLoader().getSystemResourceAsStream( Name );
    }Why are you reassigning the inputstream here again (still with the wrong Name too).
    jis = new JarInputStream(is );Even if your faulty Name there did work, you'd expect a JarInputStream to read a manifest file? Which is not a jar file at all? The file extension .MF should've clued you to that already.
    Any help would be great.Well, you're pretty much doing everything wrong. Syntactically and logically.
    Also when posting code, put it between tags and it'll format nicely.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • How to find out why my laptop freezes?

    Edit: Text like this described possible causes that were likely not to be related. On most days my laptop (Dell E6520, Sandy Bridge) freezes. That has been this way for, I think, months. I would like to learn how I can find the cause of the problem a

  • Did my hard drive crash? Do I need an upgrade? How do I upgrade? Help!

    Okay, this is going to be pretty long and I might miss some information! First of all, I have a 13" macbook. Mac OS x 10.5.8 2, 13 GHz intel core 2 Duo, 2GB. There was (and still is) an x in the battery on my screen where it should show the charging

  • HT5154 Fonts and EULA in Mountain Lion

    I can't seem to find the license document (EULA) that accompanies other fonts I have downloaded. Where is this located? Are the fonts that come with OS X mountain lion available for commercial use? Do I need to purchase an additional license? I am a

  • Some question asked by interviewer to me

    Please look at some questions and post your most valuable thoughts. 1). Can we create instance of interface or not if yes then how? Answer by me: I gave wrong answer. 2). Java is comiled langauge or interpreted langauge if compiled langauge then whic

  • Is there a way to cut a video file into pieces?

    I was just wondering if there way any way to take a video file and grab a section of it, shorten or cut it up without putting it in an editor, and therefore preserving its original format and quality? Say I took a video of something in my video camer