B4J Question B4J Packer 11 (header not found)

Discussion in 'B4J Questions' started by Peter Simpson, Jul 5, 2019.

  1. Peter Simpson

    Peter Simpson Expert Licensed User

    Hiya,
    So today I finally decided to give B4J Packer 11 a try, but no matter what project I test it with I keep coming up against the same java.util.zip.ZipException: zip END header not found error, also in the temp folder the file 'META-INF/MANIFEST.MF' is not created

    I'm using Windows 10 x64 with OpenJDK 11

    The error is apparently generated on the following line of code in 'Private Sub RunShell'.
    Code:
    Wait For shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
    Logs
    Code:
    Waiting for debugger to connect...
    Program started.
    B4JPackager11 Version 
    1.10
    InputJar: C:\Users\Peter\Desktop\CPUtoArduino\CPUtoArduino.b4j
    Running: C:\Users\Peter\Desktop\B4JPAC~
    1\Objects\temp\FindDosPath.exe
    Running: C:\Android_Development_Tools\JDK V11
    .0.1\bin\jar
    java.util.zip.ZipException: zip 
    END header not found
        at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:
    1529)
        at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:
    1430)
        at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:
    1437)
        at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:
    1268)
        at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:
    1231)
        at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:
    726)
        at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:
    843)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:
    246)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:
    176)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:
    147)
        at jdk.jartool/sun.tools.jar.Main.extract(Main.java:
    1384)
        at jdk.jartool/sun.tools.jar.Main.run(Main.java:
    403)
        at jdk.jartool/sun.tools.jar.Main.main(Main.java:
    1676)
    Thank you...
     
    Last edited: Jul 5, 2019
  2. Erel

    Erel Administrator Staff Member Licensed User

    Do you see a file named jar.jar in the temp folder? Can you unzip it?

    Worth testing with the anti-virus disabled.
     
  3. Peter Simpson

    Peter Simpson Expert Licensed User

    Hello @Erel,
    Yes the jar.jar file is in the temp folder and I've already tried running B4LPacker11 without my Anti-Virus running. I can't unzip the jar.jar file as it brings up an error.

    upload_2019-7-7_14-15-52.png

    upload_2019-7-7_14-21-25.png

    upload_2019-7-7_14-25-59.png

    Thank you...
     
    Last edited: Jul 7, 2019
  4. Peter Simpson

    Peter Simpson Expert Licensed User

    Hello Erel,

    Update:
    The error appears to be on line 134 of B4JPacker11.
    Code:
    Dim s As String = File.ReadString(TempFolder, "META-INF/MANIFEST.MF")
    The error reads as follows.
    When I go to the folder in question, all that is in the folder are the following files.
    upload_2019-7-7_14-56-41.png

    I hope that this help a bit more.

    I've been looking on our friend Mr Google for any clues, but to no avail.


    Thank you...
     
  5. Chris2

    Chris2 Member Licensed User

    Shouldn't the InputJar line in the log, and hence the InputJar set in Process_Globals point to the compiled jar rather than the .b4j file?
    So,
    should be something like;
    Code:
    InputJar: C:\Users\Peter\Desktop\CPUtoArduino\Objects\CPUtoArduino.jar
     
    Peter Simpson and Erel like this.
  6. Erel

    Erel Administrator Staff Member Licensed User

    That's the correct answer. You need to first compile the app.
     
    Chris2, DonManfred and Peter Simpson like this.
  7. Peter Simpson

    Peter Simpson Expert Licensed User

    @Chris2, @Erel,
    Cheers but that answer has actually infuriated me as I missed something so dam simple that my head has just blown a blood vessel, literally I've just lost it. I thought that I had already pointed it to the jar file, goodness knows why I pointed it to the project file, pure bloody stupidity, god I'm so angry right now.

    Dam that's really annoyed me.

    Thanks anyway...
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Don't be. It happens to all of us...
     
    OliverA and klaus like this.
  9. Chris2

    Chris2 Member Licensed User

    :) . Still being a noob (to B4J & software development in general) I almost didn't post my suggestion. Especially when @Erel replied without mentioning the InputJar.
    I guess it sometimes takes a simple mind to spot a simple solution!
     
    José J. Aguilar and Erel like this.
  10. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice