B4J Question B4J Packer 11 (header not found)

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

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,
InputJar: C:\Users\Peter\Desktop\CPUtoArduino\CPUtoArduino.b4j
should be something like;
B4X:
InputJar: C:\Users\Peter\Desktop\CPUtoArduino\Objects\CPUtoArduino.jar
 

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

Erel

Administrator
Staff member
Licensed User
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.
Don't be. It happens to all of us...
 

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