Тёмный

How to Convert/Wrap JAR into EXE file and Bundle JRE - Java Extra 33 

RyiSnow
Подписаться 28 тыс.
Просмотров 45 тыс.
50% 1

Опубликовано:

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 122   
@RyiSnow
@RyiSnow 3 года назад
I've noticed that a JNI error occurs in some environments. When that error happens, pls try to copy your jdk (usually in C:\Program Files\Java) instead of jre and also change the exe path accordingly. Sorry for the trouble!
@Iraxvii
@Iraxvii 2 года назад
Hi. When using a JDK instead of a JRE, do you include the entire JDK or just the bin and lib folders? Thank you :)
@RyiSnow
@RyiSnow 2 года назад
Only bin and lib and it worked for me :)
@bluethemcguy4430
@bluethemcguy4430 2 года назад
Thank You So Much!!! This was the exact error I got. Thank you for posting a fix about this problem! :)
@griffinbrooks6748
@griffinbrooks6748 2 года назад
@@bluethemcguy4430 Haha same! i was trying so much and i was about to comment and then saw this :D
@cayman_islands
@cayman_islands Год назад
the exe file still needs java..
@RyiSnow
@RyiSnow 4 года назад
If your image or other resources don't show up in the exported program, please check if you have specified your resources correctly in your code. Absolute address such as ".//res//image.jpg" doesn't work in exported programs (either jar or exe). If you are not sure how to specify resources, check this video that I made a while ago: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-d02PK8C5EaA.html
@MajinHico
@MajinHico 3 года назад
Underrated video, extremely useful. Thank you.
@jonahkollenberg1060
@jonahkollenberg1060 3 года назад
You are an actual national hero. Thank you so much. This video saved me. Thank you
@toshinoriyagi2460
@toshinoriyagi2460 Год назад
Has anyone had the same problem and does anyone know how to solve? The JRE tab on Launch4j is a bit different and I don't know what am I doing wrong. I used JDK version 20.0.1 and when I try to create the .exe file it does so, but it doesn't run whatsoever, while it was running as a .Jar file. Thank you in advance guys.
@michalmily4605
@michalmily4605 Год назад
hi, today I tried this for the first time... and after several errors I finally ran it. I used lib and bin folder from jdk-17. In JRE settings in launch4j(v. 3.50) i checked "JDK required" (min. JRE version 1.6.0). with these settings i am able to run it on different PCs.
@stepanzavadil
@stepanzavadil 3 года назад
nice, worked for me if you are having trouble with JRE, just put there lib and bin from JDK that you developed on ;)
@LeoOno
@LeoOno 4 года назад
awesome !!! this is something i always wanted to know. i'll definitely try it later, thanks :) !
@RyiSnow
@RyiSnow 4 года назад
Good to hear that!
@LeoOno
@LeoOno 3 года назад
@@aproe610 hey man, yeah i love @RyiSnow videos :)
@user-vs4gp4pn2n
@user-vs4gp4pn2n 3 года назад
Thank you so much.by the way if your project is a console only,then you need choose Header Type:Console at Header-->Header Type.otherwise the exe can't to run.
@CadenKoehl
@CadenKoehl 2 года назад
Thank you so much! This was incredibly helpful and informative, you just earned a subscriber!
@mimatila
@mimatila 7 месяцев назад
Great! 2 chinese guys helped a lot lately! Very good way to show things!
@jeandredegenaar9292
@jeandredegenaar9292 11 месяцев назад
Hi how do I get the .exe to run on the other device if I had to add JVM Options, I added the libraries etc. to the same file and changed the paths to use the one's in the folder. By doing this it runs on my device but not on another device.
@masoudhasanlu299
@masoudhasanlu299 6 месяцев назад
very good explanation, thank you
@perronegro4077
@perronegro4077 3 года назад
Thank you very much, you helped me a lot.
@firizz
@firizz 2 года назад
I've already done every single step, but when i click on the exe file, nothing happened
@1jhonbreinnersdh804
@1jhonbreinnersdh804 Год назад
I need help please where I can get that version of launch 3.12 at the moment it is in 3.50 and the jre configuration part of the program is different
@harounjaafar6918
@harounjaafar6918 Год назад
why don't open che exe i follow the step but there is write error whit java:[Error: A JNI error has occurred, please check your installation and try again] from the JVM launcher and after that another error: [A Java Exception has occured]. please help
@jasminemerritt1831
@jasminemerritt1831 2 года назад
When I go to specify the main class, why isn't my application package showing up?
@Dan-py2kf
@Dan-py2kf Год назад
Awesome tutorial, thank you!
@kristopherwerlinder6446
@kristopherwerlinder6446 4 года назад
I am getting [Error: A JNI error has occurred, please check your installation and try again] from the JVM launcher and after that another error: [A Java Exception has occured]. Has anyone had a similar issue or have any hints? Any help is appreciated! For context: my .jar file works perfectly fine, I have version 1.8.0 JRE and I use image and wav resources in my jar file.
@sparkfire22223
@sparkfire22223 4 года назад
hi, I have EXACTLY the same problem right down to the version of JRE I have which is also 1.8.0 - did you ever get an answer to this question?
@ednaldopereira2646
@ednaldopereira2646 4 года назад
i have the same problem
@kristopherwerlinder6446
@kristopherwerlinder6446 4 года назад
@@sparkfire22223 I have not found an answer yet unfortunately. My understanding is that with bundled JRE and Jar I can run an executable on any machine. Is this correct?
@sparkfire22223
@sparkfire22223 4 года назад
@@kristopherwerlinder6446 I think so - I know that a runnable Jar file can run as long as the machine has Java installed. So if you've got a bundled JRE (which would effectively have Java in the bundle itself) then anyone should be able to run it - just wish the wrapper could work as it would be easier than creating a bundle... I think!
@MaDCoN41
@MaDCoN41 4 года назад
same problem here! haven't found a fix yet.. :(
@axelcarre8939
@axelcarre8939 4 года назад
Insane dude!
@marcelor.aiello5050
@marcelor.aiello5050 4 года назад
Very helpful! / thks
@Aaishat
@Aaishat 5 месяцев назад
Thank you sir
@rizaangelim.servilla7723
@rizaangelim.servilla7723 3 года назад
hello thanks for the great vid but in my csse it said "error: a JNI error has occurred, please check your installation and try again" "A Java exception has occurred". i have installed the java form the website and did all your instructions but that error occurred …..
@Daaninator
@Daaninator 3 года назад
same
@Daaninator
@Daaninator 3 года назад
I fixed the issue, just replace everything in jre with all the files in c:->program files->java->jdk jdk has more information in jre and that's why we get an error
@ronakkumarpatel9991
@ronakkumarpatel9991 2 года назад
very helpful video, can you please explain if launch4j is not available is there any other way for creating a package of exe file and jre so that programme can run on any operating system
@michalmily4605
@michalmily4605 Год назад
thx for this video. very helpful.
@jokar7882
@jokar7882 3 года назад
thank you, you are the best
@Rafael-ol1ie
@Rafael-ol1ie 2 года назад
hi, can u show how can i make the application self updtable too?
@cilaaantro8801
@cilaaantro8801 Год назад
hey, when I double click my jar file, nothing happens. I tried doing a runnable jar file instead, and nothing still happens.
@cilaaantro8801
@cilaaantro8801 Год назад
nvm, I was able to fix it. I saw a reddit post saying to run the jar file on command prompt to see if any errors pop up. Apparently, jar files are much more case sensitive and there were pathfiles that i accidentally capitalized.
@alexejo8467
@alexejo8467 4 года назад
you are the messiah !!!!!!!!
@theanimalqueen8610
@theanimalqueen8610 3 года назад
This does not work for me? I have had 3 different errors depending on the system I try to execute from. 1. is main class not found, 2. is the I see the loading circle and then nothing happens, 3. This version of %1 is not compatible with the version of windows you are running. (this last one is windows 7). any help or suggestions is appreciated. Thanks!
@marwenjaffel
@marwenjaffel Год назад
Is there a solution "This version of %1 is not compatible with the version of windows you are running" ?
@prathamsarankar-csecs-0398
@prathamsarankar-csecs-0398 4 года назад
Hey! It worked but only the stage is visible in another computer.
@tangtai4011
@tangtai4011 Год назад
you are my hero! thank you so much!
@1jhonbreinnersdh804
@1jhonbreinnersdh804 Год назад
I need help please where I can get that version of launch 3.12 at the moment it is in 3.50 and the jre configuration part of the program is different
@1jhonbreinnersdh804
@1jhonbreinnersdh804 Год назад
It works for me and everything in .exe version but I pass it to another computer and it asks me for jre 17
@authenticknowledge9349
@authenticknowledge9349 4 года назад
I did exactly what he did and in order for my exe to start in a vmware pc, I had to extract it, so the jre was visible to the file explorer. Any advice would be appreciated.
@soni801
@soni801 4 года назад
using this method, the jre needs to be visible. afaik there is no way you can put the jre inside the .exe file. the standard thing to do is to copy a local jre to the programs programdata folder, using an external installer.
@stratfender89
@stratfender89 2 года назад
What do you do if you have a Jar file that isn't opening at all? I have made the cookie clicker application as well and even with JRE 1.8 on my computer it won't open. I tried converting it to an executable but it doesn't run still.
@RyiSnow
@RyiSnow 2 года назад
Did you select the entry point when you exported?
@stratfender89
@stratfender89 2 года назад
@@RyiSnow Yeah, I did and still nothing.
@RyiSnow
@RyiSnow 2 года назад
The next thing you want to check is whether resource file names are correctly typed. File names are case-sensitive in Jar while not in IDE. So typing cookieimage.png to read a file called CookieImage.png still works in IDE but not in Jar. If Jar couldn't read a file, it stops there.
@stratfender89
@stratfender89 2 года назад
@@RyiSnow So, I figured out what the problem is. It's a NullPointerException because of the audio player. I took the audio player from your point and click adventure, but this doesn't want to export for some reason :/. I've been going over the code and can't seem to find a solution except to run it in eclipse.
@RyiSnow
@RyiSnow 2 года назад
Ah ok, I just checked my P&C code and maybe I found out the cause. If you're putting your audio files in a folder in your res folder (like res/audio), then change the code like this: from URL sound1 = getClass().getClassLoader().getResource("audio/sound1.wav"); to URL sound1 = getClass().getResource("/audio/sound1.wav"); *Remove "getClassLoader" and add " / " before the folder name. When exported as jar, the ClassLoader cannot find files in a folder created in res and I think I forgot about this when I created that tutorial.
@nirbhay1564
@nirbhay1564 3 года назад
It works for both 32 bit and 64 bit os??
@cayman_islands
@cayman_islands Год назад
the exe file still needs java..
@untyoowan
@untyoowan 4 года назад
THE KING IS BACK
@erykne
@erykne 2 года назад
Thank you so much!
@sarikagarg8185
@sarikagarg8185 3 года назад
thank you sir. It is working
@P4cX
@P4cX 3 года назад
Thanks alot :)
@Yudielch2010
@Yudielch2010 4 года назад
Awesome video!
@pleaseteachme977
@pleaseteachme977 3 года назад
awesome! but how if the computer is different bit?
@tanvirrafi7483
@tanvirrafi7483 4 года назад
question what if i only send .EXE without the folder will it work?
@RyiSnow
@RyiSnow 4 года назад
As I mention in the video, EXE file only doesn't work. You need JRE to run Java programs. That's the whole point of this video anyway...
@seilimons822
@seilimons822 3 года назад
Is it possible to include the JRE files in the .exe?
@mimatila
@mimatila 7 месяцев назад
How this can be done in Linux?
@mimatila
@mimatila 7 месяцев назад
I found it out, lauch4j works both.
@fud49
@fud49 3 года назад
it wont work for me, says something about temp/launch4j
@griffydz1789
@griffydz1789 3 года назад
write the error on google, most likely has found the solution.
@sparkfire22223
@sparkfire22223 4 года назад
RyiSnow followed your steps exactly - thanks for providing such a succinct and clear guide! However, it is not working for me - and I can see another person commenting below has had the same problem... I get the error "A JNI Error has occurred, please check your installation and try again". After this it is followed by "A Java Exception has occurred". My program works perfectly - within the Eclipse IDE it runs without any problems whatsoever. are you able to assist?
@RyiSnow
@RyiSnow 4 года назад
Hi, I'm not sure exactly but that sounds like a compiler/JDK error so maybe you're compiling with a higher version of Java ? Check your Eclipse's compiler settings and see if the program is complied within the maximum version that you set in Launch4j.
@sparkfire22223
@sparkfire22223 4 года назад
@@RyiSnow Hi - It looks like the latest version of Launch4J requires JDK versions 1.6.0 to 1.8.9 -- for anyone downloading the latest Eclipse package, they'll get JDK- 13. So unless there's a solution, it looks like Launch4J hasn't managed to keep up with the latest versions of JDK. Any suggestions? Alternatively I'll see if I can find another solution - thanks for your help.
@RyiSnow
@RyiSnow 4 года назад
You can change the compiler settings by selecting Windows>Preferences>Java>Compiler on Eclipse. If your compliance level is set as 9 or later, try changing it to 1.8 and see if it works.
@christofferosgame_name5095
@christofferosgame_name5095 4 года назад
@@RyiSnow Hi, great video! Does your EXE now contain the JRE? Does this mean that the EXE file takes a larger amount of memory space compared to the JAR file? I am wondering because my EXE and JAR have the same storage space indicating that the JRE is missing in my EXE file.
@Valdrox
@Valdrox 3 года назад
@@sparkfire22223 Did you ever get any sort of resolution of this issue? I've spent 3 days now scouring the internet for ways to fix this, and I haven't come up with anything yet.
@Stev4iK_FeeD
@Stev4iK_FeeD 4 года назад
I don't understand why this video has so few views and likes...
@prathamsarankar-csecs-0398
@prathamsarankar-csecs-0398 4 года назад
There are less no. of passionate programmers, it proves.
@sarikagarg8185
@sarikagarg8185 3 года назад
how to make exe for 32bit or 64bit
@harihabicht6251
@harihabicht6251 4 года назад
thanks a lot!!
@muhammadsalem9924
@muhammadsalem9924 2 года назад
Hello Sir, I made an app using java swing +mysql How can I convert this code with its mysql database into an application that I can install on my desktop or on any other computer? Thanks
@khanfriaicha2488
@khanfriaicha2488 4 года назад
please i have to create java+mysql application installer (.exe) can i?
@soni801
@soni801 4 года назад
not with this method
@NinaNina-cz7ym
@NinaNina-cz7ym Год назад
​@@soni801with witch method plzz
@user-ku4jf6nc2g
@user-ku4jf6nc2g 4 года назад
Oh, I can't see the image in the exe file. Help me.
@RyiSnow
@RyiSnow 4 года назад
Can you see the image when you export your program as a jar file?
@user-ku4jf6nc2g
@user-ku4jf6nc2g 4 года назад
​@@RyiSnow I didn't see your video 'Ext8'. Now I've solved the problem. Your video was really helpful. Thank you. :)
@RyiSnow
@RyiSnow 4 года назад
No problem :D Glad to hear that you solved the issue!
@kaanyenel5157
@kaanyenel5157 4 года назад
you're f*cking gorgeous dude! this is exactly what I am looking for
@yanchengcheok
@yanchengcheok Год назад
Thank you. It is very helpful. Do you have idea how we can bundle the same for Linux? Also, including JRE will increase installation size significantly (around additional 214 MB), right? Thank!
@RyiSnow
@RyiSnow Год назад
Yes, it should be around that size. As for Linux, I don't have a Linux machine so I cannot check it. Sorry!
@shubhojeetbanerjee6810
@shubhojeetbanerjee6810 4 года назад
This application requires a java runtime environment 1.6.0-1.8.9 this error is coming.. please someone help
@mannyokafor4609
@mannyokafor4609 4 года назад
i have the same problem i will try to create another but without any min or max jre will notify u with results Results: Did not work an error message aswell.
@fabianvelander
@fabianvelander 4 года назад
just download the java runtime environment like it tells you to do. For me it sent me to the webpage even...
@mannyokafor4609
@mannyokafor4609 4 года назад
@@fabianvelander Do you think the user wants to download java?
@fabianvelander
@fabianvelander 4 года назад
@@mannyokafor4609 no, that's what this video is for. But YOU need to download Java Runtime Environment to run launch4j.
@mannyokafor4609
@mannyokafor4609 4 года назад
@@fabianvelander I already have, I mean the user...
@homeingbeacan5191
@homeingbeacan5191 4 года назад
What if they delete the JRE file?
@RyiSnow
@RyiSnow 4 года назад
Then I think their computer suggests them to install Java.
@ClaudioBOsorio
@ClaudioBOsorio 2 года назад
Thanks man. Nice Japanese
@nayaunglin5015
@nayaunglin5015 Год назад
arigatoo
@griffydz1789
@griffydz1789 3 года назад
Hello, are you japanese? What is your story? I am so curious. Did you go to study abroad or something like that Thanks for the video
@RyiSnow
@RyiSnow 3 года назад
Hi, thanks for watching. Yes I am Japanese. I have never lived outside of Japan but I like learning English :)
@griffydz1789
@griffydz1789 3 года назад
@@RyiSnow Your video helped a lot, i liked how you took the time to describe lot of details (icon etc), you have a good english accent. Is learning a new langage easier for someone who had to learn tons and tons of katakana hiragana and kanji? hahaa
@RyiSnow
@RyiSnow 3 года назад
Hmm I don't know for me English is actually a pretty difficult language to learn since the composition of the language is so different from Japanese. They say learning Japanese for English speakers and vice versa is the hardest learning language experience and I kind of want to agree with it :P
@griffydz1789
@griffydz1789 3 года назад
@@RyiSnow maybe i can't tell :p (i am speaking English-Arabic, curious about japanese (Daijobou, sasageyo, shotto matte, sumimasen, .. many words i heard from anime), and speak another langage aswell ahah)
@beebuumba
@beebuumba Год назад
A java exception has occurred
@6L6Lcephas
@6L6Lcephas 4 года назад
japanese awesome I don't know
@jandikable
@jandikable 3 года назад
In python or C# I suspect it would be 5 mb instead of 170 mb ))
@turrnut
@turrnut 3 года назад
日本の口音
@soni801
@soni801 4 года назад
really cute that u try to speak English :P
Далее
How to Compile Java Programs into EXEs
23:32
Просмотров 29 тыс.
УГОСТИЛ БЕЛКУ МОРОЖЕНЫМ#cat #cats
00:14
Doors Harpy Hare (Doors 2 Animation)
00:16
Просмотров 424 тыс.
C++ Developer Learns Python
9:26
Просмотров 2,7 млн
Linux File System/Structure Explained!
15:59
Просмотров 4,1 млн
A YouTuber is Copying My Tutorial
14:45
Просмотров 33 тыс.
Java executable (.jar) ☕
8:37
Просмотров 130 тыс.
УГОСТИЛ БЕЛКУ МОРОЖЕНЫМ#cat #cats
00:14