当应用程序没有错误时,为什么Eclipse jar文件会生成编译错误? [英] Why is the Eclipse jar file generating compile errors when the application does not have errors?

查看:619
本文介绍了当应用程序没有错误时,为什么Eclipse jar文件会生成编译错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Eclipse生成项目的jar文件,当我尝试使用它时,由于某些文件未包含在jar文件中,因此会给我错误。我再次重新编译了项目,在生成jar文件后,它声明Jar文件导出已完成警告,并且某些文件导出时带有编译警告。

I'm trying to produce a jar file of my project using Eclipse and when I try to use it it is giving me errors as certain files are not being included in the jar file. I recompiled the project again and after generating the jar file it states that "Jar file export finished with warnings" and certain files are exported with compile warnings.

还有其他方法生成一个jar文件?我尝试使用netbeans但它不允许我导入项目

Is there another way to generate a jar file ? I tried using netbeans but its not allowing me to import the project

推荐答案

您可以在项目属性中检查您的依赖项在项目环境中使用(项目 - >属性 - > Java构建路径)。

You can check in the project properties for the dependencies that you're using in your project environment (Project -> Properties -> Java Build Path).

如果所有必需的依赖项都不包含在您正在创建的JAR文件中,也不能在目标系统的类路径中使用,然后会出现这样的错误。

If all the necessary dependencies are not included in the JAR file that you're creating and also not available on the classpath of the target system, then such errors will occur.

你可以在JAR中打包所需的依赖项,也可以将它们单独部署到目标系统 - 您使用的方法实际上取决于依赖项是第三方库(它们应该单独部署)还是属于系统一部分的本地组件本身(它们应该打包在一起)。

You can either pack the required dependencies in your JAR or deploy them separately to your target system - which method you use really depends on whether the dependencies are 3rd party libraries (they should be deployed separately) or home-grown components that are part of the system itself (they should be packaged together).

这篇关于当应用程序没有错误时,为什么Eclipse jar文件会生成编译错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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