B4J Question B4J Packer 11 (header not found)

Peter Simpson

Expert
Licensed User
Longtime 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'.
B4X:
Wait For shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)

Logs
B4X:
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:

Peter Simpson

Expert
Licensed User
Longtime 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.







Thank you...
 
Last edited:
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Hello Erel,

Update:
The error appears to be on line 134 of B4JPacker11.
B4X:
Dim s As String = File.ReadString(TempFolder, "META-INF/MANIFEST.MF")
The error reads as follows.
java.io.FileNotFoundException: C:\Users\Peter\Desktop\B4JPAC~1\Objects\temp\META-INF\MANIFEST.MF (The system cannot find the path specified)
When I go to the folder in question, all that is in the folder are the following files.


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...
 
Upvote 0

Chris2

Active Member
Licensed User
Longtime 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,
InputJar: C:\Users\Peter\Desktop\CPUtoArduino\CPUtoArduino.b4j
should be something like;
B4X:
InputJar: C:\Users\Peter\Desktop\CPUtoArduino\Objects\CPUtoArduino.jar
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime 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...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Don't be. It happens to all of us...
 
Upvote 0

Chris2

Active Member
Licensed User
Longtime 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!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…