java - eclipse中打包可执行jar文件报错

标签 java eclipse jar packaging executable-jar

我有一个Java代码可以在eclipse中正确运行。

enter image description here enter image description here

我需要在 eclipse 之外运行这个 java 程序,所以我尝试将它导出为可执行的 jar 文件。

enter image description here

我弹出一个警告: enter image description here

然后,我有 JAR creating failed error with Resource is out of sync 消息。

enter image description here

可能出了什么问题?在eclipse外执行java程序的命令是什么?

已添加

谷歌搜索 ( Eclipse source out of sync with file system ) 以删除 resource is out of sync 错误,但我有很多 duplicate errors

enter image description here

为什么会出现这些错误?我怎样才能删除它们?我从 mercurial 存储库下载了项目。

最佳答案

我可以生成可执行的 jar,这是为了让它工作我必须做的总结。

删除重复文件。

我发现一些错误消息说有重复的文件。我不明白为什么 eclipse 认为有重复文件,但通过删除文件,我可以删除错误。

排除部分文件

在构建中 -> 配置构建路径 enter image description here

我不得不删除或排除源文件夹。

enter image description here

始终通过刷新同步

我必须使用 F5 键来刷新构建,或者我可以使用 eclipse 设置自动执行此操作:enter image description here

关于java - eclipse中打包可执行jar文件报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12538968/

相关文章:

java - "Gradle Dependencies"无法在 'Apache Tomcat' 运行配置中正确显示

java - 如何让tomcat使用扩展名为.jar的文件夹作为jar文件?

java - 如何在 MS Windows 中使用命令行将 TXT 文件添加到 WAR 存档

android - 编辑布局时在 "tools palette"中显示我的自定义布局

java - 如何使用eclipse检测java类中的空主体方法?

java - 运行 jar 后继续在控制台执行

java - 连接到 Microsoft SQL Server 2005 中的数据库引擎

java - 字符串分词器 : split string by comma and ignore comma in double quotes

java - NoClassDefFoundError : org/apache/commons/lang3/StringUtils

javascript - 过滤器未显示在网格中