找不到IntelliJ编译错误zip END标头 [英] IntelliJ Compilation Error zip END header not found

查看:96
本文介绍了找不到IntelliJ编译错误zip END标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题

我无法在Java 9和10上的IntelliJ build 182.4505.22上为导入的Eclipse项目编译Java代码.在编译模块或任何单个文件时显示以下错误:

I am unable to compile Java code for an imported Eclipse project on IntelliJ build 182.4505.22 on Java 9 and 10. The following error is displayed when compiling the module, or any individual file:

Error:(1, 1) java: cannot access edu.wit.cs.comp2000

zip END header not found

详细信息

项目的结构如下:

完整的编译时输出如下:

The full compile-time output is as follows:

已经尝试

我在此处和<请参见http://a href ="https://stackoverflow.com/questions/44899421/java-9-zip-end-header-not-found-exception">此处,其中没有提供任何相关详细信息.我尝试在Java 9和Java 10上进行编译,这没有什么区别.我已将一个主要方法写入LinkedBag,并尝试独立于JUnit运行该方法,这将导致相同的错误.IntelliJ无法在我的测试类中正确显示测试图标,因此我怀疑JUnit(或缺少JUnit)是问题的原因,但是我不确定如何继续.编译其他项目的工作(没有JUnit测试)就可以了.

I have reviewed posts here and here, which do not provide any relevant details. I have attempted compiling on both Java 9 and 10, which makes no difference. I have written a main method into LinkedBag and attempted to run that independent of JUnit, which results in the same error. IntelliJ is not correctly displaying the testing icons in my test class, so I suspect that JUnit (or lack of JUnit) is the cause of the issue, however I am unsure how to proceed. Compiling works for other projects (without JUnit tests) just fine.

更新

  • 该代码似乎可以在Java 1.8上按预期进行编译和测试,而不会出现问题.每次切换到Java 9或10都会导致上述问题.我开始怀疑教师的一个依存关系特别需要Java 1.8,但是如果有人有解决方案,我仍然想使用Java的较新版本.

推荐答案

如上所述,只需删除损坏的缓存并重新启动Intellij.

As mentioned above, just delete the corrupted cache and restart Intellij.

在命令行中运行gradle可以帮助您了解应删除的内容.例如:

Running gradle in the commandline can help knowing what you should delete. For instance:

$ ./gradlew --version
Could not unzip /home/cesarc/.gradle/wrapper/dists/gradle-5.6.2-all/9st6wgf78h16so49nn74lgtbb/gradle-5.6.2-all.zip to /home/cesarc/.gradle/wrapper/dists/gradle-5.6.2-all/9st6wgf78h16so49nn74lgtbb.
Reason: error in opening zip file

然后删除文件夹/home/cesarc/.gradle/wrapper/dists/gradle-5.6.2-all/9st6wgf78h16so49nn74lgtbb文件夹后,问题已解决:

and after deleting the folder /home/cesarc/.gradle/wrapper/dists/gradle-5.6.2-all/9st6wgf78h16so49nn74lgtbb the problem was solved:

$ ./gradlew --version
Downloading https://services.gradle.org/distributions/gradle-5.6.2-all.zip
......

这篇关于找不到IntelliJ编译错误zip END标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆