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

查看:35
本文介绍了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:

已经尝试

我在这里此处,未提供任何相关详细信息.我曾尝试在 Java 9 和 10 上进行编译,这没什么区别.我已经在 LinkedBag 中编写了一个 main 方法,并试图独立于 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天全站免登陆