简体   繁体   English

Eclipse-导出可运行的JAR文件(警报弹出窗口)

[英]Eclipse - Exporting Runnable JAR File (alert popup)

I'm totally misunderstanding something about exporting a project to a JAR. 我完全误解了有关将项目导出到JAR的事情。

2 things are happening. 2件事正在发生。

First, I get an alert while exporting the Runnable JAR File: 首先,在导出Runnable JAR文件时收到警报:

Exported with compile warnings: prj.Resources/classes/Person.java 导出并带有编译警告:prj.Resources / classes / Person.java

My Project is called prj.HelloWorld . 我的项目称为prj.HelloWorld The main function resides here. 主要功能位于此处。 It is also referencing another projects resources, which happens to be prj.Resources . 它还引用了另一个项目资源,恰好是prj.Resources (I added that project to the Java Build Path for prj.HelloWorld ) (我将该项目添加到prj.HelloWorld的Java构建路径中)

So, the Person.java class is performing just fine, but I still get the compile warning. 因此,Person.java类的性能很好,但是我仍然收到编译警告。 What does that warning mean? 该警告是什么意思?

Second, when I double-click my helloworld.jar file, which I saved to my desktop, I don't see any images in the MenuBar Items. 其次,当我双击保存到桌面的helloworld.jar文件时,在MenuBar Items中看不到任何图像。 I'm calling icons from within both projects. 我正在两个项目中调用图标。 When I run the compiler from inside Eclipse, everything shows fine. 当我从Eclipse内部运行编译器时,一切正常。

-As I'm exporting the Runnable JAR File, I'm selecting the " Extract required libraries into generated JAR ", under the Library handling option. -在导出可运行的JAR文件时,在“库处理”选项下,选择“将所需的库提取到生成的JAR中 ”。

What am I doing wrong, with images? 使用图片我在做什么错?

Window -> Show View -> Problems

This will open up a view which will show any problems in the program. 这将打开一个视图,其中将显示程序中的任何问题。 Warnings are not critical, but notices of possibly deprecated functions and other things that should be changed. 警告不是很关键,但是会通知您可能已弃用的功能以及应更改的其他内容。

The images are in wrong place/folder so that eclipse ignore them during the build process. 图像放在错误的位置/文件夹中,因此在构建过程中日食会忽略它们。 If you don't have this folder( src/resources ) try to create it and put your images in it 如果您没有此文件夹( src/resources ),请尝试创建它并将图像放入其中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM