簡體   English   中英

構建一個jar文件

[英]Building a jar file

我想用eclipse構建一個jar文件,但該程序似乎將不必要的文件復制到jar中。

我的java gui程序項目包括:

<path>/src/data/program.java [this is the gui]
<path>/src/data/testcases/testcase.java [here are testcases stored, which are executed by program.java]
<path>/src/data/system/config.ini [heres some data stored which is collected to set settings inside the program.java]
<path>/src/bin/.../classes.class [here are the classes stored  by eclipse(program.class / testcase.class)]
<path>/ExtRes/externallibary.jar [here are some external libaries stored]
<path>/ExtRes/Templates [here are some templates with information stored which program.java collects when used]
<path>/Img/image.png [image folder for icons inside the program]
<path>/Logs/.../somelog.txt [here are some logs stored which are output of the program.java]

所以漸進的問題是如何最好地對這些文件進行排序。

而基本問題是如何生成一個主要只包含program.java的jar?

編輯:感謝基礎問題的答案!

還請解決上述問題:

排序java gui程序文件的常用/最佳方法是什么?

右鍵單擊Project explorer中的項目,選擇Export,選擇Java-> Jar文件,然后您可以選擇要包含哪些類和文件,哪些不包含。

在eclipse中下載fatjar作為更新站點和http://fjep.sourceforge.net/並按照提到的方式使用它。 這很容易。 或者按照Jakub Zaverka提到的步驟進行操作。 你可以根據自己的要求制作Runnable Jar或簡單的jar

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM