Java executable Jar File
Asked Answered
Z

5

6

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
Zootoxin answered 23/4, 2012 at 11:51 Comment(2)
Alter the compilation settings used by the IDE to show details of the warnings.Nominal
To find out more about the run-time errors, launch the app. from the command line using something like java -jar the.jarNominal
M
5

"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.

Mohamed answered 23/4, 2012 at 12:5 Comment(0)
A
3
  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
Aerophone answered 23/4, 2012 at 11:57 Comment(3)
I tried with this but it is exported with warning and the jar file is not executingZootoxin
Try fixing the warnings before you export.Winny
Do you have a main class that is executable? Do you have a main function? If you hit 'run' from within eclipse does it run?Trilley
S
0

File->Export->Runnable JAR File

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

Stines answered 23/4, 2012 at 11:52 Comment(2)
I tried with this but it is exported with warning and the jar file is not executingZootoxin
warnings don't prevent you from launching jar. Try $java -jar filename.jar. What happends? What exactly do you mean saying "does not work"Stines
I
0

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.

Insincerity answered 16/11, 2020 at 13:42 Comment(0)
S
-1

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

Spherule answered 23/4, 2012 at 12:20 Comment(3)
"Warning is just fine" Warnings should not be ignored. They are reported for a reason.Nominal
@Andrew I am not sure how this warnings cause problem to make jar as executable. could you please explain. I know very well that there is a purpose.Spherule
It depends what the warnings are, still waiting for details from the OP.Nominal

© 2022 - 2024 — McMap. All rights reserved.