happyjack27 / autoredistrict

Programmatically makes a fair congressional district map (prevents gerrymandering)
GNU General Public License v3.0
89 stars 15 forks source link

Build is broken: ZipException in JDK 21 due to jcom.jar #213

Closed Noreaster76 closed 1 year ago

Noreaster76 commented 1 year ago
  1. Checked out latest master branch.
  2. Executed the following step to build, per the README, and got the following result:
➜  autoredistrict git:(master) javac -encoding UTF-8 -d bin -cp 'src:jcom.jar' src/ui/Applet.java
src/ui/Applet.java:1: error: cannot access ui
package ui;
^
  ZipException opening "jcom.jar": ZIP file can't be opened as a file system because entry "/../manifest.mf" has a '.' or '..' element in its name
1 error
printing javac parameters to: /Users/gabe/Programming/autoredistrict/javac.20231020_154033.args
➜  autoredistrict git:(master) ✗

Using the latest stable release of the JDK:

➜  autoredistrict git:(master) ✗ javac --version
javac 21.0.1
Noreaster76 commented 1 year ago

StackOverflow says to re-zip the JAR, but opening it with Archive Utility yields a .cpgz file (?) and you can't open it from the Terminal, either:

➜  jcom tar -xvf jcom.jar
x jp/
x jp/ne/
x jp/ne/so_net/
x jp/ne/so_net/ga2/
x jp/ne/so_net/ga2/no_ji/
x jp/ne/so_net/ga2/no_ji/jcom/
x jp/ne/so_net/ga2/no_ji/jcom/Com.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/
x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelApplication.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelFont.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelRange.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorkbook.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorkbooks.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorksheet.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorksheets.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlFileFormat.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlPageBreak.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlSaveAsAccessMode.class
x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlSheetType.class
x jp/ne/so_net/ga2/no_ji/jcom/GUID.class
x jp/ne/so_net/ga2/no_ji/jcom/IDispatch.class
x jp/ne/so_net/ga2/no_ji/jcom/IEnumVARIANT.class
x jp/ne/so_net/ga2/no_ji/jcom/IPersist.class
x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$ElemDesc.class
x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$FuncDesc.class
x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$TypeAttr.class
x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$VarDesc.class
x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo.class
x jp/ne/so_net/ga2/no_ji/jcom/ITypeLib$TLibAttr.class
x jp/ne/so_net/ga2/no_ji/jcom/ITypeLib.class
x jp/ne/so_net/ga2/no_ji/jcom/IUnknown.class
x jp/ne/so_net/ga2/no_ji/jcom/JComException.class
x jp/ne/so_net/ga2/no_ji/jcom/ReleaseManager.class
x jp/ne/so_net/ga2/no_ji/jcom/VariantCurrency.class
x jp/ne/so_net/ga2/no_ji/jcom/VariantError.class
x ../manifest.mf: Path contains '..'
tar: Error exit delayed from previous errors.

It looks like this JAR is super old, like from 2007 or so. Is it possible to replace it with something more up to date?

happyjack27 commented 1 year ago

.jar are compressed in pkzip format. so you can just rename the file extension to .zip and then you can extract the contents.

then just re-zip and rename to .jar again

On Fri, Oct 20, 2023, 2:48 PM Gabe Heafitz @.***> wrote:

StackOverflow https://stackoverflow.com/questions/71727905/maven-fails-to-find-files-in-main-package-zip-file-cant-be-opened-as-a-file-sy says to re-zip the JAR, but opening it with Archive Utility yields a .cpgz file (?) and you can't open it from the Terminal, either:

➜ jcom tar -xvf jcom.jar x jp/ x jp/ne/ x jp/ne/so_net/ x jp/ne/so_net/ga2/ x jp/ne/so_net/ga2/no_ji/ x jp/ne/so_net/ga2/no_ji/jcom/ x jp/ne/so_net/ga2/no_ji/jcom/Com.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelApplication.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelFont.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelRange.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorkbook.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorkbooks.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorksheet.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorksheets.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlFileFormat.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlPageBreak.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlSaveAsAccessMode.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlSheetType.class x jp/ne/so_net/ga2/no_ji/jcom/GUID.class x jp/ne/so_net/ga2/no_ji/jcom/IDispatch.class x jp/ne/so_net/ga2/no_ji/jcom/IEnumVARIANT.class x jp/ne/so_net/ga2/no_ji/jcom/IPersist.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$ElemDesc.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$FuncDesc.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$TypeAttr.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$VarDesc.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeLib$TLibAttr.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeLib.class x jp/ne/so_net/ga2/no_ji/jcom/IUnknown.class x jp/ne/so_net/ga2/no_ji/jcom/JComException.class x jp/ne/so_net/ga2/no_ji/jcom/ReleaseManager.class x jp/ne/so_net/ga2/no_ji/jcom/VariantCurrency.class x jp/ne/so_net/ga2/no_ji/jcom/VariantError.class x ../manifest.mf: Path contains '..' tar: Error exit delayed from previous errors.

It looks like this JAR is super old, like from 2007 or so. Is it possible to replace it with something more up to date?

— Reply to this email directly, view it on GitHub https://github.com/happyjack27/autoredistrict/issues/213#issuecomment-1773311543, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPM2QMB4XFYUTREXNNSZUDYALISNAVCNFSM6AAAAAA6JPZ6L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZTGMYTCNJUGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

happyjack27 commented 1 year ago

jcom is for interacting with ms excel or ms word via "component object model" (COM) not sure of its needed.

On Fri, Oct 20, 2023, 3:49 PM Kevin Baas @.***> wrote:

.jar are compressed in pkzip format. so you can just rename the file extension to .zip and then you can extract the contents.

then just re-zip and rename to .jar again

On Fri, Oct 20, 2023, 2:48 PM Gabe Heafitz @.***> wrote:

StackOverflow https://stackoverflow.com/questions/71727905/maven-fails-to-find-files-in-main-package-zip-file-cant-be-opened-as-a-file-sy says to re-zip the JAR, but opening it with Archive Utility yields a .cpgz file (?) and you can't open it from the Terminal, either:

➜ jcom tar -xvf jcom.jar x jp/ x jp/ne/ x jp/ne/so_net/ x jp/ne/so_net/ga2/ x jp/ne/so_net/ga2/no_ji/ x jp/ne/so_net/ga2/no_ji/jcom/ x jp/ne/so_net/ga2/no_ji/jcom/Com.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelApplication.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelFont.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelRange.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorkbook.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorkbooks.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorksheet.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/ExcelWorksheets.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlFileFormat.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlPageBreak.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlSaveAsAccessMode.class x jp/ne/so_net/ga2/no_ji/jcom/excel8/XlSheetType.class x jp/ne/so_net/ga2/no_ji/jcom/GUID.class x jp/ne/so_net/ga2/no_ji/jcom/IDispatch.class x jp/ne/so_net/ga2/no_ji/jcom/IEnumVARIANT.class x jp/ne/so_net/ga2/no_ji/jcom/IPersist.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$ElemDesc.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$FuncDesc.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$TypeAttr.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo$VarDesc.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeInfo.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeLib$TLibAttr.class x jp/ne/so_net/ga2/no_ji/jcom/ITypeLib.class x jp/ne/so_net/ga2/no_ji/jcom/IUnknown.class x jp/ne/so_net/ga2/no_ji/jcom/JComException.class x jp/ne/so_net/ga2/no_ji/jcom/ReleaseManager.class x jp/ne/so_net/ga2/no_ji/jcom/VariantCurrency.class x jp/ne/so_net/ga2/no_ji/jcom/VariantError.class x ../manifest.mf: Path contains '..' tar: Error exit delayed from previous errors.

It looks like this JAR is super old, like from 2007 or so. Is it possible to replace it with something more up to date?

— Reply to this email directly, view it on GitHub https://github.com/happyjack27/autoredistrict/issues/213#issuecomment-1773311543, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPM2QMB4XFYUTREXNNSZUDYALISNAVCNFSM6AAAAAA6JPZ6L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZTGMYTCNJUGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Noreaster76 commented 1 year ago

Does anyone have a Windows machine? We could test whether any MS Office functionality breaks when the JAR is removed.

happyjack27 commented 1 year ago

In order to even know what to test, you"d first have to search for references to it in the code. And then if you don't find any or the other ones you find can easily be removed, then you're done.

On Mon, Oct 23, 2023, 6:44 AM Gabe Heafitz @.***> wrote:

Does anyone have a Windows machine? We could test whether any MS Office functionality breaks when the JAR is removed.

— Reply to this email directly, view it on GitHub https://github.com/happyjack27/autoredistrict/issues/213#issuecomment-1775013526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPM2QPJC6CYHND7P4EFYITYAZKCBAVCNFSM6AAAAAA6JPZ6L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZVGAYTGNJSGY . You are receiving this because you commented.Message ID: @.***>

Noreaster76 commented 1 year ago

.jar are compressed in pkzip format. so you can just rename the file extension to .zip and then you can extract the contents. then just re-zip and rename to .jar again

Screenshot 2023-10-24 at 2 38 56 PM

Also doesn't work at the command prompt. I'm going to investigate removing the JAR altogether.