sohel14_cse_ju
sohel14_cse_ju

Reputation: 2521

Java executable Jar File

I am trying to make an executable jar file from eclipse (using MySQL as database).

How can can I make the executable jar file?

I made one but it shows some warning and not works. I am getting a long warning list. Here is the warning:


 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

Upvotes: 6

Views: 34715

Answers (5)

prageeth
prageeth

Reputation: 7395

This can happen when you have a java class where the content of which is fully commented out. However, the created jar should most probably work.

Upvotes: 0

Avil
Avil

Reputation: 453

Warning is just fine this will not cause a problem with the executable jar.

Check <Your JAR name>.jar\META-INF\MANIFEST.MF by unarchiving the jar file and find Main-Class: <your entry point class with main method>.

If this Main-Class is not there then something went wrong while creating jar.

Make sure you follow proper steps. Please check this guide for creating jar as a reference.

Note: you can manually edit MANIFEST.MF

Upvotes: -1

Estragon
Estragon

Reputation: 1462

"it shows some warning and not works" Keep in mind that we won't be able to help you much if you don't provide details on what error you encounter : https://i.sstatic.net/jjCat.jpg

Eclipse may warn you that your executable jar file has been created with warnings. It just means that your classes have warnings (yellow !). It doesnt mean at all that the produced jar file won't work.

Upvotes: 5

Shamli
Shamli

Reputation: 82

  1. Right click on the project which you need to export as jar
  2. Select the option 'Export' from the list
  3. From the new pop up, select 'Runnable jar file'
  4. Click 'next' button
  5. In the next window give a name for your jar and the launch configuration (the class with main method)
  6. Select the appropriate option for the required libraries and click finish button

Upvotes: 3

AvrDragon
AvrDragon

Reputation: 7479

File->Export->Runnable JAR File

Then you can choose, weather you want copy jars in jar or just extact them

Upvotes: 0

Related Questions