Have a .java file/program that you would like to run outside of JAVA’s environment, change it from java to exe? You have come to the right place!
This is the complete guide to convert a JAVA file to JAR file and then convert the JAR file to EXE file which will result your JAVA program to become executable.
It is a simple follow along guide, you do not require any knowledge on the programs used here. Two main programs used are the in-built command prompt and Launch4j. The only requirement is patience.
For this case scenario, I have created a simple GUI in JAVA which display a pop-up box with “Hello World” written in it. Let’s start!
Create Java file/ Locate Java file
Step 1: First of all, Locate your java file you would like to convert to an executable file.
Step 2: Open command prompt (windows key + r, type “cmd”, press “ok”)
Step 3: Locate to the folder you have your java file using “cd” command.
Step 4: Let’s compile your java file to create a class file. Type “javac yourfilename.java”.
Check if your file is working with “java yourfilename.java”.
Convert JAVA file to JAR file
Step 5: Secondly, lets convert your whole file to a JAR file. JAR file is a java archive file that contains all your data and resources used in your java file as a single archive file. We need this to bundle all our files to make them executable.
Type “jar cvf yourfilename.jar yourfilename.class”.
Editing MANIFEST.MF from JAR
Step 6: Thirdly, try running your jar file using “java -jar yourfilename.jar”. You will encounter an error “no main manifest attribute, in yourfilename.jar”. This is caused because the jar file we created creates a default manifest.mf file which does not know where your main method is located.
(Check this by opening jar file as ZIP. It is located inside “META-INF/MANIFEST.MF”)
Step 7: Now we need to add the main method located class to the manifest file from outside of the jar file.
Step 8: Let’s create a simple text file named “manifest.txt”. Add “Main-Class: yourfilename”, “yourfilename.java” must contain the main method which executes your whole program. Make sure you enter an extra line of empty space at the end. Save the file.
***Do not try to add this manually to the MANIFEST file inside JAR file, It will corrupt it.***
Step 9: Go back to command prompt and type “jar cmf manifest.txt yourfilename.jar yourfilename.class”. This command will add the main method located class inside “MANIFEST.MF” file.
Step 10: Let’s check if the JAR file runs now. It works!
Convert JAR file to EXE file using Launch4j 3.5
Step 11: Finally, we can convert to executable by converting our JAR file to EXE file. For this, we require you to download the application Launch4j here.
***Reminder: Please install the 3.5 version, another version may cause error because it might require you to sign the EXE file***
Launch the app.
JAR to EXE: How to Use Launch4j?
Step 12:
- Choose where you would like to place your EXE file by naming it in “Output file:”
- Select the Jar file we created from “Jar”.
- Use “Wrapper manifest:” for UAC(User Account Control)
- “Icon:” is used to select your desired icon for the EXE file
- Hold your mouse for further queries of other functons in textfields
Step 13: We need to define JRE minimum version for EXE to be compatible with. Check your JRE(Java Runtime Environment) by typing “java -version” in command prompt. Select your java version or earlier.
Step 14: Click the floppy disk icon in the top left to save the .xml file anywhere you like.
Step 15: Then click the settings icon in top left to create the EXE file, which should give you a similar message like this:
Step 16: Locate the EXE file where you saved it, and run it! JAVA to EXE is done!
Conclusion
In conclusion, the complete guide to convert a JAVA file to an executable file is fairly easy but requires no mistakes. Now, you do not need the JAVA environment to run your file. If you encounter any errors and/or have suggestions, please leave a comment below! We will get back to you as soon as possible!
Read our other articles:
Co-owner of Xiloop Technologies and Technoloxy.
Tech enthusiast, constantly learning and sharing knowledge.
benicar tablet
phenergan gel
lexapro cost
avodart tab price
albenza otc
allopurinol 300
buy azithromycin over the counter usa
cipro otc
zofran 2018
sumycin price
azithromycin order online
advair 230 21 mcg
vermox price in south africa
buy fildena online
can i buy dexamethasone over the counter
advair 100
bactrim online
erectafil 20
cafergot tablets price
anafranil anxiety
cost of advair without insurance
sildalis 120
finpecia tablet price in india
erythromycin topical
order lexapro
buy colchicine online
aurogra 100
atarax for itching
chloroquine covid 19
clonidine hcl 0.1
antabuse medication
digoxin cost
albenza
synthroid 0.175
motilium drug
colchicine
atarax 10
zofran iv
suhagra online purchase in india
proscar 2016
bactrim 480
allopurinol price south africa
allopurinol 150
clonidine 2.0
clopidogrel tabs
aurogra tablets
buspar canada
erectafil 10
erythromycin canada
buspar online uk
medication allopurinol pills
albendazole cost canada
hydrochlorothiazide brand
cheap bactrim
hydrochlorothiazide price
vermox canada prescription
prednisolone uk
prednisolone cost usa
buy dipyridamole
keflex prescription cost
albendazole for sale uk
bactrim price canada
buying motilium online uk
phenergan without a prescription
erectafil 20 online
elimite otc prescription
buy avodart online canada
buy cozaar cheap
where can i buy vermox online
motilium uk prescription
indocin over the counter
avodart
cephalexin for sale uk
phenergan over the counter uk
seroquel 500
generic cafergot tablets
generic lopressor
perfect
thank you for a very good article
zofran cheap
cheap cipro
tadacip 20 tablet
anafranil for ocd
buying motilium online uk
sildalis 120
tadacip from india
synthroid medicine in india
5jswu
obpu3
4foj
jntny
aaxjl
8mxk
qylpa
dp9al
loq1
aoi6l
nlfdg
s4i0
bafyi
ysaqc
dsug
albenza
k56wo
0mo35
zjxt
vp1m8
gdk0v
st9f
phenergan otc australia
2kmeq
l2ej6
3u7i
usc5x
67qwc
8i4d
generic antabuse
https://postmailmed.com/ list of otc products
buy cipro cheap
In order to rule out any detrimental effects of the tool, it is recommended that players turn off their antivirus programs while installing the tool.
While double weaving might be one of the most interesting and fun-factor changes to Final Fantasy XIV, this addition absolutely needs a deep understanding of how servers work internally and how each action behaves. In an optimal scenario, double weaving should be turned on for about 30 minutes and with attention put in on going ‘around’ the said actions.
Subscribe: https://cadowteti.weebly.com
6add127376 glepig
generic lyrica medication
lyrica medicine generic
anafranil generic cost
lyrica generic usa
commmark 353a2c1c90 https://ko-fi.com/post/Deadislandv100trainer-Latest-2022-X8X5CP9NX
elfrnor 353a2c1c90 https://www.cakeresume.com/portfolios/adobe-premiere-pro-cc-7-0-0-serial-number
chloroquine cost per pill
raians 353a2c1c90 https://wakelet.com/wake/z3qu8Nh4thjUv1e7EgErO
prycfee 353a2c1c90 https://melaninterest.com/pin/refx-nexus-2-mac-full-download-gaylcha/
hamdar 353a2c1c90 https://wakelet.com/wake/Q6M99-Y-0AK3tM_DqWc5R
synthroid india
atarax for ic
chloroquine 300
synthroid 175 mcg coupon
chloroquine generic
daygeof 244d8e59c3 https://wakelet.com/wake/CNaokD758EmZNh4_lbjwx
babichan 244d8e59c3 https://public.flourish.studio/story/1523011/
jairsasc 244d8e59c3 https://wakelet.com/wake/Ll3zCBKq3D2U2Q5fYuXjT
ullrury 244d8e59c3 https://wakelet.com/wake/uF9OPEuiIUGa12X9gf01x
shanoha 244d8e59c3 https://wakelet.com/wake/CE-ssWZcd7GJbuynVA34D
badgwil 244d8e59c3 https://wakelet.com/wake/JWTTeCMYYmKM9kUYSHt17
ellken f1579aacf4 https://dribbble.com/shots/18210585-Batch-Picture-Resizer-Crack-Free-For-Windows
colchicine brand name generic
vermox purchase
zdzindy f50e787ee1 https://wakelet.com/wake/W7WZR10pPAELGHYE8tsv_
nicwali f50e787ee1 https://wakelet.com/wake/rbwCHya-n9stTN7UZKXam
hilcan f50e787ee1 https://wakelet.com/wake/6fz203Yi0QpxZOKExpk2-
hoakgian f50e787ee1 https://wakelet.com/wake/FKV9WpyzHvlGz3JSqKcBr
ghyelmi f50e787ee1 https://wakelet.com/wake/ct1Aq4zOUnrv3_mie0AQw
harmar f50e787ee1 https://wakelet.com/wake/8RHD6ACBu3jp-MIL9JoGD
jortama f50e787ee1 https://wakelet.com/wake/RRWY4ueiP8I0tBmFE42O_
amaale f50e787ee1 https://wakelet.com/wake/a_u-eMYw-iNxjwDMMcdbb
marbyes f50e787ee1 https://wakelet.com/wake/2ESAca2afhi2Hv95pYKgj
fatmyale f50e787ee1 https://wakelet.com/wake/L8NNmBaGck9kNYgLP7KsL
kielhar f50e787ee1 https://wakelet.com/wake/fbM6C_dX6Yz8yKSRcXFXG
forforr f50e787ee1 https://wakelet.com/wake/ryxfbBrV8Lq1a1-tBSEu0
hatgar f50e787ee1 https://wakelet.com/wake/wc9Mo_374Nc0956oGAIGv
likebor f50e787ee1 https://wakelet.com/wake/dsuzmkBMyvbHonDHJLaU3
haldawn f50e787ee1 https://wakelet.com/wake/Wc2rpMfjAuscDdLzNlTrC
jannquir f50e787ee1 https://wakelet.com/wake/eD6G3ZRLjt7WMPgxB1FcI
quarzolt f50e787ee1 https://wakelet.com/wake/O_Y60SBDySNNFJXckVzJv
phillaty f50e787ee1 https://wakelet.com/wake/4D6EDhzg6zd8VIXj4l6aY
vermox in usa
maricar f50e787ee1 https://wakelet.com/wake/bGcAwQKQQH3zqI5wtal9A
jaltho f50e787ee1 https://wakelet.com/wake/r-IzHkERMSwpu_xHnQLmM
kalter f50e787ee1 https://wakelet.com/wake/kHq3Fc_j_JC6u1duKYSTZ
vermox tablets uk
jaranat f6d93bb6f1 https://coub.com/stories/5050444-1password-password-torrent-registration-rar-64
lanlacr f6d93bb6f1 https://coub.com/stories/5029707-what-are-720-subtitles-avi-720-blu-ray-hd-watch-online
reibai f6d93bb6f1 https://coub.com/stories/5057079-rar-elements-of-workshop-tech-logy-by-hajra-choudhary-vol-1-full-version-epub-download-ebook
reibai f6d93bb6f1 https://coub.com/stories/5057079-rar-elements-of-workshop-tech-logy-by-hajra-choudhary-vol-1-full-version-epub-download-ebook
emamar f6d93bb6f1 https://www.guilded.gg/exhoroheas-Parade/overview/news/4ldV71ny
zofran for sale
budesonide 25
buy colchicine singapore
raiskat fe9c53e484 https://wakelet.com/wake/aiW8idJIN5hrn0YHtNdbW
https://atarxotc.com/ hydralazine for anxiety
ysobpalo fe9c53e484 https://trello.com/c/QMN4K4QC/108-international-basketball-manager-22-versi%C3%B3n-completa-2022
tadjamm fe9c53e484 https://www.guilded.gg/rsercoripes-Creed/overview/news/9RVgXZ9l
lyvwai fe9c53e484 https://public.flourish.studio/story/1316700/
spelero fe9c53e484 https://wakelet.com/wake/oyez9PVxNfGN8mJOUlVeF
dahyale fe9c53e484 https://wakelet.com/wake/G-hyl_H240rLRZr1uGeeR
lavilov fe9c53e484 https://wakelet.com/wake/z4tu7cIZB0YhjE4z1M5Hp
berharc fe9c53e484 https://wakelet.com/wake/s9Tqi2z-DPw9GW8rRn5aT
fideli baf94a4655 https://trello.com/c/0wGggDa6/40-descargar-domynyo-gratuita
vidderr baf94a4655 https://www.guilded.gg/adligacas-Hawks/overview/news/A6jnWQk6
charkarm baf94a4655 https://coub.com/stories/4910491-descargar-feeding-frenzy-2-deluxe-version-completa
felagoli baf94a4655 https://coub.com/stories/4936849-descargar-nib-u00fb-version-pirateada-2022
pancar baf94a4655 https://trello.com/c/38Wh9X8P/69-descargar-sharpshooter-plus-versi%C3%B3n-completa-gratuita
vygdimi baf94a4655 https://trello.com/c/T0qxhcDY/78-city-play-versi%C3%B3n-completa
raetam baf94a4655 https://trello.com/c/nbqwHlZl/40-object-ward-versi%C3%B3n-pirateada-2022
singulair otc switch
zevaunt baf94a4655 https://trello.com/c/4KnfUOoQ/45-twisted-sails-versi%C3%B3n-pirateada-2022
carldaen baf94a4655 https://coub.com/stories/4958044-descargar-automobiels-and-the-eisenhower-hiway-system-the-game-gratuita
kriseve baf94a4655 https://trello.com/c/ck35Lq3o/54-monochroma-versi%C3%B3n-pirateada-2022
jourund baf94a4655 https://coub.com/stories/4929616-descargar-iridion-3d-gratuita
olivdal baf94a4655 https://coub.com/stories/4939807-descargar-tactical-soccer-the-new-season-gratuita
elllinl baf94a4655 https://www.guilded.gg/cusspassdefnuos-Rebels/overview/news/dl7rX9AR
bercars baf94a4655 https://coub.com/stories/4952744-descargar-horizon-s-gate-gratuita
quyjol baf94a4655 https://www.guilded.gg/raucubidests-Hawks/overview/news/BRw9Wj76
valanc baf94a4655 https://coub.com/stories/4944975-descargar-ballpoint-universe-infinite-version-completa
buy lopressor
ghaque baf94a4655 https://coub.com/stories/4947145-descargar-project-fox-online-gratuita-2021
nocorev baf94a4655 https://trello.com/c/FSO3wi4e/82-descargar-blacksmith-hit-gratuita
joywhit baf94a4655 https://trello.com/c/9Zd7zmpi/45-descargar-mpaliens-versi%C3%B3n-completa
ondengl baf94a4655 https://trello.com/c/4s5fIwCp/119-age-of-conquest-iv-versi%C3%B3n-completa-gratuita-2022
yarakail baf94a4655 https://coub.com/stories/4915231-nummels-version-pirateada-2022
ollmaka baf94a4655 https://coub.com/stories/4918065-just-power-the-papal-states-version-completa-gratuita-2021
wyllquin baf94a4655 https://trello.com/c/QJZ5cdrd/80-gunslinger-trainer-versi%C3%B3n-pirateada-2021
hatblu baf94a4655 https://trello.com/c/VA7miZ9S/16-descargar-the-last-monsters-versi%C3%B3n-completa
rhodenl ef2a72b085 https://wakelet.com/wake/n5ubY2qDzZxG_3Y-zHkCY
singulair australia
urzmanl ef2a72b085 https://wakelet.com/wake/emZ2zT_mNSaey2X6ea8Ih
loutnemu ef2a72b085 https://wakelet.com/wake/Zb5UPA19QQWZ3JhQgxZDf
berwjair ef2a72b085 https://wakelet.com/wake/tSPxSmozR_0wM1fUWILnH
nasdor ef2a72b085 https://wakelet.com/wake/8owbiXOvKvAgbCwNCSWX9
katpor ef2a72b085 https://wakelet.com/wake/k3d4a3TR17UgKqfIb5HW5
taibra ef2a72b085 https://wakelet.com/wake/EGErZ6ETBVfGNGks7_wVP
buy lyrica cheap
budecort 100
elimite otc price
budesonide otc
where to buy elimite
flomax blood pressure
https://unsplash.com/@willowbun1
avodart price in india
aralen retail price
cafegot
phiamm 63b95dad73 https://marketplace.visualstudio.com/items?itemName=0vepeneumu.Contus-Video-Gallery-Plugin-For-Wordpress-Nulled-Plugins
yoound 63b95dad73 https://marketplace.visualstudio.com/items?itemName=ALEXrapAD.Download-Mini-Kms-Activator-Office-2010-V-11-64-Bi-EXCLUSIVE
waiing 63b95dad73 https://marketplace.visualstudio.com/items?itemName=unefacna.Akaneiro-Ni-Somaru-Saka-Opening-Full-HOT-Version
lanhan 63b95dad73 https://marketplace.visualstudio.com/items?itemName=unefacna.Apdf-Password-Security-Crack-Serialsgolkes-NEW
elimite
elimite price
where can i buy elimite
rilegenn cbbc620305 https://marketplace.visualstudio.com/items?itemName=1procaclika.HOT-Holt-Sociology-The-Study-Of-Human-Relationships-St
bunnbir cbbc620305 https://marketplace.visualstudio.com/items?itemName=olegslom.Nikon-Camera-Control-Pro-28-Serial-15
jusorvy cbbc620305 https://seitaguarno8.artstation.com/projects/036XaY
saretak cbbc620305 https://marketplace.visualstudio.com/items?itemName=krislain.Antrenmanlarla-Matematik-1-Pdf-Indir-WORK
hallgav f23d57f842 https://www.guilded.gg/wilmerofoots-League/overview/news/Plq142Bl
wilcorw f23d57f842 https://www.guilded.gg/tedlecubous-Outlaws/overview/news/4lGg4JOl
verlmarq f23d57f842 https://www.guilded.gg/forkeybuwatchs-Senators/overview/news/bR9pxz0y
scrakesh f23d57f842 https://www.guilded.gg/liatajasapps-Mustangs/overview/news/2lMMmJLl
bianaza f23d57f842 https://www.guilded.gg/annoihescounts-Garrison/overview/news/V6Xb1M0R
ysanblac f23d57f842 https://www.guilded.gg/dustsumcimskuns-Bruins/overview/news/16YVQp8y
owengar f23d57f842 https://www.guilded.gg/seyroponos-Falcons/overview/news/A6eM2wN6
reedar f23d57f842 https://www.guilded.gg/respcalados-Titans/overview/news/BRwBX9Ly
lyndays f23d57f842 https://www.guilded.gg/ireremocs-Panthers/overview/news/4yAZAEvR
whakary f23d57f842 https://www.guilded.gg/cragexeceeds-Cowboys/overview/news/r6BpQGAR
bibquen f23d57f842 https://www.guilded.gg/snideresfats-Wolverines/overview/news/9loe8qPy
janyar f23d57f842 https://www.guilded.gg/marsdikeges-Storm/overview/news/BRwPK1pl
kalayaja f23d57f842 https://www.guilded.gg/ehedersios-Bulldogs/overview/news/Gl52kgP6
dorelw f23d57f842 https://www.guilded.gg/vunlalimos-Clan/overview/news/vR135dv6
alevlad f23d57f842 https://www.guilded.gg/syswadeheadhs-Pride/overview/news/JRNmJLMy
latzym f23d57f842 https://www.guilded.gg/spitewladsais-Greyhounds/overview/news/Ayk7ZxVy
glywad f23d57f842 https://www.guilded.gg/henszekirets-Club/overview/news/x6geA3jR
zanwad f23d57f842 https://www.guilded.gg/ateratims-Patriots/overview/news/zy438pz6
halwgil f23d57f842 https://www.guilded.gg/porroteges-Rams/overview/news/r6BbArY6
edvayel f23d57f842 https://www.guilded.gg/quomonsandsimps-Panthers/overview/news/dlv8xbjy
gorgarv f23d57f842 https://www.guilded.gg/diomasuppbris-Stallions/overview/news/x6gYgeGR
pamtali f23d57f842 https://www.guilded.gg/inkwaginins-Hurricanes/overview/news/XRz1pEEy
avrywalt 89fccdb993 https://www.guilded.gg/codeskuamags-Lightning/overview/news/x6ge24gR
vermox us
margavr 89fccdb993 https://www.guilded.gg/erdotkeyties-Chargers/overview/news/X6QPMZ7l
irelyle 89fccdb993 https://www.guilded.gg/sizznoonceres-Crew/overview/news/16YVX2oy
herfarr 89fccdb993 https://www.guilded.gg/displancogis-Vikings/overview/news/glbXO9Ky
cautphy 89fccdb993 https://www.guilded.gg/ematgrahers-Dark-Force/overview/news/bR9mWMeR
eiddbert 89fccdb993 https://www.guilded.gg/vodadotans-Monarchs/overview/news/Plq10pVl
arnpan 89fccdb993 https://www.guilded.gg/grubwoeracres-Chiefs/overview/news/XRz1b7Ky
wilaudr 89fccdb993 https://www.guilded.gg/subsrodoquars-Club/overview/news/qlDJ3Xky
suhagra 100 online purchase
arimidex singapore
nenbev b42d3ba3f7 https://www.kaggle.com/slicetmesmo/microsoft-plus-for-windows-xp-old-vers-fenwan
arimidex for sale canada
no prescription allopurinol
motilium tablet cost
lopressor medication
bricae b8d0503c82 https://coub.com/stories/4642619-battlefield-3-windows-license-torrent-cracked-full-version-ultimate-zip
haregmo b8d0503c82 https://coub.com/stories/4698764-cracked-xs-ryplayer-21-iso-x32-full
hamlbely b8d0503c82 https://coub.com/stories/4586586-serial-who-is-on-my-wifi-activation-exe-download-ultimate-64-full-version
nidimar b8d0503c82 https://coub.com/stories/4578992-si-by-si-2-third-l-zip-torrent-full-mobi
lillfer b8d0503c82 https://coub.com/stories/4576853-iso-sun-microsystems-software-free-patch
https://public.sitejot.com/circlegreece.html
motilium online
singulair prescription
atarax medicine atarax for insomnia atarax uk buy
cephalexin online uk
triamterene drug
elimite over the counter uk
where can i buy cafergot tablets
germyes d9ca4589f4 https://wakelet.com/wake/HFPWwlUrYn_hoXRwsDaFL
sirgard d9ca4589f4 https://wakelet.com/wake/qrlAsLp3xbs-c3c_PIkjK
jarmdave d9ca4589f4 https://wakelet.com/wake/HXk_c2_suwR1E6opurVgl
jayvyr d9ca4589f4 https://wakelet.com/wake/uzJUA0i6HbG7OOJnSW8NJ
genlac d9ca4589f4 https://wakelet.com/wake/2wWD9dws7RtAVjlQ0eRUt
egisaf d9ca4589f4 https://wakelet.com/wake/4YWyRB_EggvT825BFX-R3
buy elimite otc
acticin cream buy
hanubl 31ebe8ef48 https://wakelet.com/wake/SlXjBGfbGussY6FzUm81T
kacoka 31ebe8ef48 https://wakelet.com/wake/UKCLwM3gnDNdsuAGq_Uxn
ardfiak 31ebe8ef48 https://wakelet.com/wake/6oXVjaKrtn1y7717RCdom
celekry 31ebe8ef48 https://wakelet.com/wake/QSgQFrV1AQD-TmOHAkiSc
gilelsb 31ebe8ef48 https://wakelet.com/wake/j-F-jDD4UEhIjnAb6PzdR
dresdar 31ebe8ef48 https://wakelet.com/wake/iwVgf7xIp_C9TliORfsYq
elaeir 31ebe8ef48 https://wakelet.com/wake/ByAUnDAxSXJQocvgiB2cl
harudo 31ebe8ef48 https://wakelet.com/wake/ioZF2AKfWGxh9tbzV-KxA
tannava 31ebe8ef48 https://wakelet.com/wake/M6R2t-rNFVybD_6-gV4L-
quyraig 4a48e5f205 https://wakelet.com/@lustcitanga842
vinsjar 4a48e5f205 https://wakelet.com/@veabichangta777
buy tadacip from india
deseelfr 4a48e5f205 https://wakelet.com/@wildpertionel476
ginehea 4a48e5f205 https://wakelet.com/@crevincarpay102
fildena 150 for sale
carchan 4a48e5f205 https://wakelet.com/@lustjenewplin790
jakkber 4a48e5f205 https://wakelet.com/@zhengmangvenne264
malegra 25
generic zofran price
antibiotic cephalexin
synthroid
motilium canada over the counter
aleiamal afbfa58eb4 https://documen.site/download/leadbelly-library-of-congress-recordings-torrent_pdf
where to buy avodart
azithromycin prescription online
cafergot over the counter
brand benicar
can i buy vermox over the counter
wystglo cceab18d79 https://coub.com/stories/3213391-torrent-alldata-v10-52-alldata-auto-repair-link
benicar prescription cost
laurumay cceab18d79 https://coub.com/stories/3252700-link-kanamachi-bengali-movie-720p-55
amhharl cceab18d79 https://coub.com/stories/3310979-compound-interest-common-core-algebra-2-homework
elimite cream otc
Hello and thank you for the tutorial. My program uses an imported .jar file (mail.jar). Everything works up until I try to run the
java -jar Myprogram.jar and I get
Error: Unable to initialize main class Myprogram
Caused by: java.lang.NoClassDefFoundError: javax/mail/Authenticator
I’m not sure how to handle the mail.jar file
Thank you in advance for your help.
Great article!!!
Important tip (at least for me): when create manifest.txt, don’t forget to add new line at the mentioned text.
See https://docs.oracle.com/javase/7/docs/technotes/tools/windows/jar.html: An existing manifest file must end with a new line character. jar does not parse the last line of a manifest file if it does not end with a new line character.
Thank you! Updated!
Iam using lunch4j and bundled the jre 1.8 version. And it takes 2-3minutes to start the application . Could you please help me find the reason
I would suggest to rebundle in a different JRE version and see if there are any changes. As for the reason, we would first need to see if the problem is from launch4j or JRE. To test it, try to run the JAR file and if the load time is the same on JAR file then the problem lies within JAVA rather than launch4j. Do tell us the result after you test!
My program is a little more complex than “Hello World” It uses the Scanner class but outside of that it’s not complex. It doesn’t start when I click it, but it shows no errors. Clicking the play button in Launch4j just freezes it. What could I be missing? It runs fine in Command Prompt
Do you have a GUI to run the program on like swing? If not, im assuming you are trying to run your code through cmd window. If so then, you need to manually add code in your java file to execute cmd.exe using Runtime and Process classes which will pop open your your executable in cmd. If you do have a GUI setup, then make sure your manifest file is configured properly like shown above.
i follow exactly the “HELLO” program.
Generated EXE show error “A JNI error has occurred, please check your installation and try again “
Hello there! This type of error occurs when you have two different java JDK and/or JRE versions installed. You have probably compiled the file in the latest version and tried to run in a different previously installed older version. To fix this error, try to uninstall the previous version so that you have only one JDK to run the program from.
Regards,
Technoloxy