我正在尝试从eclipse创建一个可执行的jar文件(使用MySQL作为数据库)。
如何制作可执行jar文件?
我做了一个,但它显示了一些警告而不起作用。我得到一个很长的警告清单。这是警告:
JAR export finished with warnings. See details for additional information.
Exported with compile warnings: AngalTask/src/org/isf/accounting/gui/PatientBillEdit.java
Exported with compile warnings: AngalTask/src/org/isf/accounting/gui/BillBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/admission/gui/AdmissionBrowserOld.java
Exported with compile warnings: AngalTask/src/org/isf/admission/gui/AdmittedPatientBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/admission/gui/AdmissionBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/disease/gui/DiseaseEdit.java
Exported with compile warnings: AngalTask/src/org/isf/disease/gui/DiseaseBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/exa/gui/ExamBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/exa/gui/ExamEdit.java
Exported with compile warnings: AngalTask/src/org/isf/help/gui/AboutWindow.java
Exported with compile warnings: AngalTask/src/org/isf/lab/gui/LabNew.java
Exported with compile warnings: AngalTask/src/org/isf/lab/gui/LabBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/lab/gui/LabEditExtended.java
Exported with compile warnings: AngalTask/src/org/isf/lab/gui/LabPrintFrame.java
Exported with compile warnings: AngalTask/src/org/isf/lab/gui/LabEdit.java
Exported with compile warnings: AngalTask/src/org/isf/lab/manager/Results.java
Exported with compile warnings: AngalTask/src/org/isf/medicals/gui/MedicalBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/medicals/gui/MedicalEdit.java
Exported with compile warnings: AngalTask/src/org/isf/medicalstock/gui/MovStockBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/medicalstock/gui/MovStockInserting.java
Exported with compile warnings: AngalTask/src/org/isf/medicalstockward/gui/WardPharmacy.java
Exported with compile warnings: AngalTask/src/org/isf/medicalstockward/gui/WardPharmacyEdit.java
Exported with compile warnings: AngalTask/src/org/isf/menu/gui/UserEdit.java
Exported with compile warnings: AngalTask/src/org/isf/menu/gui/Menu.java
Exported with compile warnings: AngalTask/src/org/isf/menu/gui/MainMenu.java
Exported with compile warnings: AngalTask/src/org/isf/menu/gui/Login.java
Exported with compile warnings: AngalTask/src/org/isf/menu/gui/UserBrowsing.java
Exported with compile warnings: AngalTask/src/org/isf/menu/gui/SubMenu.java
Exported with compile warnings: AngalTask/src/org/isf/menu/gui/SplashWindow3.java
Exported with compile warnings: AngalTask/src/org/isf/opd/gui/OpdEdit.java
Exported with compile warnings: AngalTask/src/org/isf/opd/gui/OpdBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/opd/gui/OpdEditExtended.java
Exported with compile warnings: AngalTask/src/org/isf/operation/gui/OperationEdit.java
Exported with compile warnings: AngalTask/src/org/isf/operation/gui/OperationBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/patient/gui/PatientInsertExtended.java
Exported with compile warnings: AngalTask/src/org/isf/patvac/gui/PatVacEdit.java
Exported with compile warnings: AngalTask/src/org/isf/patvac/gui/PatVacBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/priceslist/gui/PricesBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/serviceprinting/print/MedicalStockSelection.java
Exported with compile warnings: AngalTask/src/org/isf/serviceprinting/print/MedicalPrintSelection.java
Exported with compile warnings: AngalTask/src/org/isf/stat/reportlauncher/gui/ReportLauncher.java
Exported with compile warnings: AngalTask/src/org/isf/therapy/gui/TherapyEdit.java
Exported with compile warnings: AngalTask/src/org/isf/therapy/gui/TherapyEntryForm.java
Exported with compile warnings: AngalTask/src/org/isf/utils/jobjects/JAgenda.java
Exported with compile warnings: AngalTask/src/org/isf/utils/jobjects/ShadowBorder.java
Exported with compile warnings: AngalTask/src/org/isf/utils/jobjects/FixedFrame.java
Exported with compile warnings: AngalTask/src/org/isf/utils/time/TimeComboBox.java
Exported with compile warnings: AngalTask/src/org/isf/vaccine/gui/VaccineBrowser.java
Exported with compile warnings: AngalTask/src/org/isf/vaccine/gui/VaccineEdit.java
Exported with compile warnings: AngalTask/src/org/isf/video/gui/VideoDevicesPanel.java
答案 0 :(得分:2)
"它显示一些警告而不是工作" 请注意,如果您没有提供有关遇到的错误的详细信息,我们将无法为您提供更多帮助:http://imgur.com/jacoj
Eclipse可能会警告您已经创建了带有警告的可执行jar文件。这只意味着你的班级有警告(黄色!)。它并不意味着生产的jar文件不会起作用。
答案 1 :(得分:1)
答案 2 :(得分:0)
文件 - >导出 - >可运行的JAR文件
然后你可以选择,天气你想在罐子里复制罐子或只是接触它们
答案 3 :(得分:0)
当您有一个Java类,其内容被完全注释掉时,可能会发生这种情况。但是,创建的jar很可能可以工作。
答案 4 :(得分:-1)
警告很好,这不会导致可执行jar的问题。
通过取消归档jar文件检查<Your JAR name>.jar\META-INF\MANIFEST.MF
并找到Main-Class: <your entry point class with main method>
。
如果没有Main-Class
,那么在创建jar时会出现问题。
确保遵循正确的步骤。请将此guide for creating jar作为参考。
注意:您可以手动修改MANIFEST.MF