Export JavaFX 11, 15 or 17 projects into an executable jar file with IntelliJ [2022]

Поділитися
Вставка
  • Опубліковано 30 лис 2024

КОМЕНТАРІ • 252

  • @ahmedfawad51
    @ahmedfawad51 3 роки тому +21

    really appreciate your work, these steps should have been specified by Intellij on their website, it really made my day after hours of failed research my project finally works with the jar .. PS this is my first comment on youTube ever since i made my account 10 years ago :D cheers

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      Thank you so much! It is an honor to be your first comment in 10 years :D

    • @hahahouhis2783
      @hahahouhis2783 2 роки тому

      I strongly agree with you. It was not about hours... It was about days!😝
      Good job!

  • @DanielAndersson0
    @DanielAndersson0 3 роки тому +19

    I've spent at least 10 hours trying to figure out how to do exactly this, trying numerous other tutorials all of which didn't work for me... Unbelievable that it was this simple, and so difficult to find a tutorial explaining this method! Thank you so much!

    • @Randomcode_0
      @Randomcode_0  3 роки тому +1

      Glad I could help! I had the same problem, and when I then finally found a decent solution, I thought I would share it.

  • @artemykrylov
    @artemykrylov 3 роки тому +13

    Thanks to you, I found a solution for MacOS. I added all the ".dylib" files from the "javafx-sdk / lib" directory to the artifact.
    And it worked the same way as you have with ".dll" files.

  • @jimthompson9215
    @jimthompson9215 3 роки тому +6

    I've been trying to export an available jar for one day till I found this video... Thanks A LOT!!!! It helps me and save me A LOT of time.

  • @pinnball7992
    @pinnball7992 3 роки тому +3

    This is the first way I have found that actually works. You are a hero. Now feel like i have completed Java! Thank you much.

  • @ahmadfx8962
    @ahmadfx8962 3 роки тому +1

    even the intellij web site did not give the solution to solve this problem ...thank you very very much

    • @Randomcode_0
      @Randomcode_0  3 роки тому +1

      I am just very happy I could help :)

  • @devenvaru
    @devenvaru Рік тому

    God bless you brother, for 6 days i was figuring out why it was not working but it was so simple and I can finally move on. Thank you

    • @Randomcode_0
      @Randomcode_0  Рік тому

      I'm glad you figured it out! Wishing you the best as you move forward.

  • @IslamTheRightWay10
    @IslamTheRightWay10 2 роки тому +3

    Dosent work for me

  • @zachwatkins639
    @zachwatkins639 Рік тому

    As others have stated, the amount of time that I have spent on this is insane. Thank you so very much, you have ended my suffering!

  • @MrFunny01
    @MrFunny01 3 роки тому +1

    I don't beleive that creating ANOTHER class will help. such a bruh moment. BUT IT ACTUALLY WORKED. Ty

  • @Cecil_Augus
    @Cecil_Augus Рік тому

    Tysm. Not even GPT was explaining this correctly to me.

  • @StateFucker
    @StateFucker Рік тому

    I tried 3 days to get an executable file. Now it works. Thanks for your video!😀

    • @Randomcode_0
      @Randomcode_0  Рік тому

      Glad my video helped! Congrats on getting the executable file! 😀

  • @user-rx3ny9ji8i
    @user-rx3ny9ji8i Рік тому +5

    Concise and just what I needed to get it working (when it obviously should out of the box). I indeed needed the 'fake' main class + the added DLL to make it auto executable, each one alone wouldn't be enough to make it work.
    Also for those that let Intellij download the JavaFX files, the default Intellij location for those will be : C:\Users\YOUR_USER\.openjfx\cache
    There, you will have folders depending on the version of JDK used. For me with JDK 19 it was in a '19+ 11' folder, then amd64, and then all those precisous DLLs
    Hope it can help more people (and maybe the maintainer at JetBrain or JavaFx update something ? (ಠ﹏ಠ)

  • @keesb8656
    @keesb8656 2 роки тому +1

    You're the greatest. I've spend a day not getting the solution. The internet only talks about adding your sdk folder. Appearantly extending from Application was my error.

  • @anderdesantos4045
    @anderdesantos4045 2 роки тому

    I've spent too many hours trying to export it into a jar program and this is the only way that worked for me. All the answers were the same except for the solution in this video and is the one that worked

    • @Randomcode_0
      @Randomcode_0  2 роки тому

      It can sometimes be a bit magical, I'm just glad yo hear you got it working!

  • @user-yz5hj3zg2x
    @user-yz5hj3zg2x Рік тому

    It worked!! I can't believe that it worked, after weeks trying to find an answer, it finally worked! You're a lifesaver!

  • @ErnienatorLego
    @ErnienatorLego 3 роки тому +2

    Thank you so so much. Your Video helped me after already giving up. I think the most tutorials dont tell that you have to add all the .dll files. You safed my day

  • @RK-zg9cd
    @RK-zg9cd Рік тому +1

    Huge thanks man) i tried to make a jar-file using maven commands, but it kept throwing out a strange error, google didn't help. But ofc your metod helped me)

  • @ЛюблюТактики-ъ1к
    @ЛюблюТактики-ъ1к 3 роки тому +2

    It just doesn't work. Jar won't start. I have JavaFX11. (I added a check mark in the place where we added the files) Wow, it works now. You really helped me. I will recommend you 🧐

  • @eugenvonderkipe6031
    @eugenvonderkipe6031 3 роки тому +1

    Thanks a lot! I had to write software for an academic paper for my degree course and couldnt get it to run outside my IDE. If it wasnt for this vid I would not have been able to finish it.

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      Wow! I am glad I could help and good luck regarding you academic paper!

  • @xXHolger1980Xx
    @xXHolger1980Xx 2 роки тому +1

    Thank you! I searched for the solution for a long time, your video helped me!

  • @beetrout7705
    @beetrout7705 3 роки тому +1

    Thank you sooooo much!!! Ive been searching internet for this for so long.

  • @michaelangel379
    @michaelangel379 2 роки тому +2

    It works, thanks dude. I have another solution using excel and some files but this is clean

    • @Randomcode_0
      @Randomcode_0  2 роки тому +1

      Great to hear! It is always good to search for new and different solutions.

  • @faiadhossainchowdhury6690
    @faiadhossainchowdhury6690 7 місяців тому

    really appreciate your work , keep creating this type of videos

  • @masco4268
    @masco4268 Рік тому

    thanks man, you helped me a lot. I was struggling with this problem for about 4 hours now... Thank you

  • @bystruska8560
    @bystruska8560 2 роки тому

    This vide saved me at least 3 times :D I allways run into this problem and then im searching for this video :D best video on the internet.

    • @Randomcode_0
      @Randomcode_0  2 роки тому

      Great to hear! I do that all the time as well :D

  • @MarkTheMadMan
    @MarkTheMadMan 3 місяці тому

    Great video, however in JavaFX 20 you don't need all the files in the bin folder to be included. You only need - glass . dll, javafx_font . dll and prism_d3d . dll if you just have a basic FXML JavaFX application with the 4 main modules (javafx . base, javafx . controls, javafx . graphics and javafx . fxml). If you use more modules you might need more dll dependancies ofc

    • @Randomcode_0
      @Randomcode_0  3 місяці тому +1

      Thank you very much for letting us know. The beauty of software is that it keeps evolving.

  • @elhoussem3594
    @elhoussem3594 2 роки тому +1

    Sir, I did all the steps but the jar file won't to start or launch .... I have : jdk-17.0.2 and jdk-18.0.1.1 and javafx-sdk-18.0.1.
    the problem is in Eclipse and Intellij ..... just on javafx but for just java there is no problem.
    I worked on Swing on Eclipse and the jar file work correctly .... I don't know why in javafx nothing work when I export but and compilation it work well ??!

  • @shlomighty
    @shlomighty 2 роки тому +1

    Straight to the point and concise, Thank you so much man!

  • @martinsauer4854
    @martinsauer4854 3 роки тому +1

    You should do a follow up video on this but with maven and not just JavaFX but any possible dependency

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      That is a pretty good idea I might do that! :)

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      Check out my newest video it should be what you are looking for:
      Create executable jar file for JavaFX 15 using Maven: ua-cam.com/video/EyYb0GmtEX4/v-deo.html

  • @mixuz91
    @mixuz91 Рік тому

    Oh my god.. such a simple fix.. Thank you, you saved my sunday.. :)

  • @darios5355
    @darios5355 9 місяців тому

    Even though this video is old it helped me a lot!
    I just want to leave that comment here to say thank you!

  • @JamesBrodski
    @JamesBrodski Рік тому +2

    God bless you sir! It actually worked thank you so much :)

  • @benjaming7219
    @benjaming7219 Рік тому

    Thank you, I've been trying to figure out why it wasn't taking the jxml file and went through 2 ide's to try and solve this.

  • @bizzoulabaou
    @bizzoulabaou Рік тому +1

    This does not work for me.
    I just have: A Java Exception has occurred.
    I can run it with "java -jar test.jar" though.

    • @H2P_TPL
      @H2P_TPL 5 місяців тому

      have you done it

  • @SaNiKuS101
    @SaNiKuS101 Рік тому

    Thank you so much, my friend! I have spend the whole evening, trying to figure out, what am I doing wrong and now I see this video! Sry for my bad english...

  • @mahiram.7282
    @mahiram.7282 3 роки тому +2

    Thank you so much. I have been stuck on this for days.

  • @HurriKate414
    @HurriKate414 Рік тому

    THANK YOU so much for this! IntelliJ really does not make this an easy process.

  • @algot34
    @algot34 2 роки тому +1

    2:07 where can I download those JavaFX folders? I don't have them and can't seem to find a download link anywhere. I have version 19. On gluonhq There are no .dll files or bin folder for version 19.

  • @_Pinda_
    @_Pinda_ Рік тому

    I rarely comment but your video helped me a lot thanks 💯

    • @Randomcode_0
      @Randomcode_0  Рік тому

      I am very grateful for your comment and glad to hear my video was good enough to deserve one of your rare comments!

  • @khanhsb15
    @khanhsb15 2 роки тому

    Thanks you, it's very helpful !. For those who encounter the error: "Error: JavaFX runtime components are missing, and are required to run this application when export .jar file" when run .jar file with command: "java -jar app.jar". Let's add dependencies in pom.xml:
    org.openjfx
    javafx-base
    12


    org.openjfx
    javafx-controls
    12


    org.openjfx
    javafx-graphics
    12
    win


    org.openjfx
    javafx-fxml
    12


    org.openjfx
    javafx-web
    12


    org.openjfx
    javafx-media
    12


    org.openjfx
    javafx-swing
    12

  • @rainb0_0
    @rainb0_0 3 роки тому +1

    TNX SO MUCH
    I was stuck at first part myself

  • @s3nsimilla193
    @s3nsimilla193 3 роки тому +2

    Hey, I'm trying to do the same but on Mac OS. I mean I want to build artefacts on Mac OS but I want to run a program in Windows 10. Unfortunately it does not works. The only way I can run a program on windows is use cmd and "java --module-path path/to/fx/lib --add-modules JavaFX.controls, JavaFX.fxml - jar app.jar". I added all DLL's but this does not works :(

    • @Randomcode_0
      @Randomcode_0  3 роки тому +1

      I am not a Mac OS user and have never been, so I have no idea why it doesn't work. Hope you figure it out! :)

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      @s3nsi milla,
      I can see you posted another comment but for some reason it is not showing.
      But regarding your qustion, I am using JavaFX JDK 15 in this video.

  • @miniman251
    @miniman251 2 роки тому

    Thank YOu!!!!!!!!!!!!!!!! After all the videos on youtube, this is the only method that works! thank you so much!

  • @moardub
    @moardub 2 місяці тому

    Tysm! What a nightmare trying to figure this out. I followed other tutorials but it had to be all of these steps for it to work. I wonder why it doesn't like the "extends Application" in main part...? Thx again!

    • @Randomcode_0
      @Randomcode_0  Місяць тому +1

      I am actually not 100% sure. I struggled to get things working, found some random article providing this solution, and then didn't ask any questions. But I would assume there are some hardcoded starting points somewhere causing issues, but that is just my guess.

  • @mirzafardeen1257
    @mirzafardeen1257 3 роки тому +1

    So when I click on jar file , nothing really happens

  • @DeeTasticGaming
    @DeeTasticGaming Рік тому

    Not all heroes wear capes. No but seriously, thank you so much! I was about to rip my hair out, and I'm bald.. so like, that wouldn't have went well!

    • @Randomcode_0
      @Randomcode_0  Рік тому

      I know the feeling! I also struggled getting this working and just wanted to share what I found, but this sadly do not work for everyone.

  • @ShujaaAhmad
    @ShujaaAhmad Рік тому +1

    Thankyou very much for making this video. ✨

  • @ThanhNguyen-ts2ks
    @ThanhNguyen-ts2ks Рік тому

    Help me!
    I'm trying to build jar file from lesson #17: FileChooser: saving files, but it doesn't work.
    could someone explain to me why?
    By the way, thank Random code for this great course! really appreciate your work.

  • @Kanimeworld534
    @Kanimeworld534 3 роки тому +1

    It worked thank you so much was stucked here from days .Just one doubt how you selected all files at once from bin?

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      I selected all the files by first clicking on the first file then holding down shift and clicking on the last files, then all files in between will also be selected (I use Windows btw).

  • @le_nonexistent8528
    @le_nonexistent8528 Рік тому

    Well-explained and functional, this gem really helped me out!

    • @Randomcode_0
      @Randomcode_0  Рік тому

      That is so great to hear! These videos are getting a bit older, but good to hear they can still be valuable.

  • @VsevolodRostovskiy
    @VsevolodRostovskiy Рік тому

    Thank you for the video! I am just starting to learn Java. Please tell me, this jar file does not require anything other than JVM? Are all required libraries packed into a jar file?

    • @Randomcode_0
      @Randomcode_0  Рік тому

      If the jar file was created with all of its dependencies included, then it should not require any other libraries or dependencies to run other than the JVM. However, if the jar file was created without including all of its dependencies, then it may require other libraries or dependencies to be available on the system to run.
      In most cases, we can create what is called a fat jar to include all needed dependencies.

    • @VsevolodRostovskiy
      @VsevolodRostovskiy Рік тому

      @@Randomcode_0 Thanks a lot!

  • @lukasschonwetter9717
    @lukasschonwetter9717 2 роки тому

    Maybe someone runs in to the same problem as me: this didn’t work with java 18 (Oracle OpenJDK version 18.0.1), but it did work with java 17 (Oracle OpenJDK version 17.0.1)

    • @Randomcode_0
      @Randomcode_0  2 роки тому +1

      For some reason, most "tricks" only seem to work for some versions. Which is a bit annoying.

  • @makkusaiko
    @makkusaiko 2 роки тому +1

    Thanks dude. You really helped me

  • @abdelhakbekheitia6210
    @abdelhakbekheitia6210 2 роки тому

    i don't know how to thank you man
    and i don't know why the other tutorial didn't mention these steps
    can you please explain what you have done in this video and why you added those files from javaFx sdk ??
    and thanks again

    • @Randomcode_0
      @Randomcode_0  2 роки тому

      I am glad I could help!
      JavaFX used to be a part of basic Java, however, it was removed from Java 11, we, therefore, need to manually add all the JavaFX functionality to our projects. What we are doing is simply adding java code we can then reference and use like a button or a text field.

    • @abdelhakbekheitia6210
      @abdelhakbekheitia6210 2 роки тому +1

      @@Randomcode_0 thank you so much man I really appreciate your help
      i spent a lot of time looking for a solution

  • @HereticFalcon
    @HereticFalcon 2 роки тому

    Hi!
    What do you think about to make a video for Kotlin TornadoFx project import to jar with IntelliJ and with gradle? I only found written examples on Stackoverflow and none of them works for me. Thanks in advance!

  • @es-vs3ey
    @es-vs3ey 3 роки тому +1

    Thanks!!! It works fine :)
    Can you maybe explain why you need to get all the files from the bin folder?

    • @Randomcode_0
      @Randomcode_0  3 роки тому +2

      Glad I could help!
      We need to get the files from the bin folder because we are creating a normal jar file (Not including JavaFX), we then manually need to get the JavaFX files into the jar file to get it working with JavaFX (the bin folder contains all the JavaFX classes). We cannot just create a JavaFX Jar file because the newer versions of JavaFX have some problems.
      Hope this explains it :)

    • @es-vs3ey
      @es-vs3ey 3 роки тому +1

      @@Randomcode_0 Thank you for your answer ! :)
      Could you tell me the source where this is explained or documented? I can't find any usefull explanation on IntelliJ or JavaFX (openjfx-docs).

    • @Randomcode_0
      @Randomcode_0  3 роки тому +1

      @e s This way of doing it is not a "proper" way, and I doubt any real documentation exists, at least not that I know of. This is just a way it worked for me in the past, I am sorry I cannot give you a better answer :)

    • @es-vs3ey
      @es-vs3ey 3 роки тому +1

      @@Randomcode_0 Thank you anyway for your efforts mate :)

  • @legoaggelos2722
    @legoaggelos2722 Рік тому

    is there a way to make the file smaller? 41mb for a small program like that is a little big

  • @klarissaclairiton9010
    @klarissaclairiton9010 2 роки тому

    This works for a simple program with no additional libraries. My program uses additional libraries such as Lucene for text searching and Java mail for sending messages. My program reads a file at startup as well. Error: Could not find or load main class main.AncestryLaunch
    Caused by: java.lang.ClassNotFoundException: main.AncestryLaunch

    • @Randomcode_0
      @Randomcode_0  2 роки тому

      You are very much right, this is a very manual apraoch only working for JavaFX. Building larger and more complex project you should always use a build tool like maven or gradle.

  • @jrcastle
    @jrcastle Рік тому

    Thank you for your video, helps me a lot. Nevertheless mi application doesn´t find the files (words, html, database) needed to work propertly. It´s seem that all the paths are wrong. I checked the jar file and have the same structure than my proyect, and in IntelliJ it´s work perfect. Any Idea why it´s happening??

    • @Randomcode_0
      @Randomcode_0  Рік тому

      You would need your files to have a relative path, which can be used by the project. This means you should place any file you interact with in the resource folder and retrieve them as if they were located there. If this is not the issue, I am not quite sure.

  • @maryamparsa3606
    @maryamparsa3606 2 роки тому

    hi: please tell us ; maven or gradl used in this project? thanks a lot

    • @Randomcode_0
      @Randomcode_0  2 роки тому

      In this video I am neither, it is a plain Java application where I manually added JavaFX. I would recommend using Maven.

  • @mateuszsojka7775
    @mateuszsojka7775 3 роки тому

    I followed your way and everything worked great beside the init() and stop() methods... is there a way to make them work as normal? or maybe some workaround? I am getting really hard time with it.

  • @quenyanwarrior8741
    @quenyanwarrior8741 Рік тому

    does maven or gradle will have anything affecting the steps you mentioned?

    • @Randomcode_0
      @Randomcode_0  Рік тому +1

      Gradle is built on Maven so I would assume it should be possible to achieve the same result with both, however I am not too familiar with Gradle so I can't say for sure.

  • @pamirsahak
    @pamirsahak 3 роки тому +1

    Hi
    i did everything exactly the same but the built jar file is not opening not giving even an error, However i built a swing GUI app it works.
    i have this problem only in JavaFX project.

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      I am sorry I got no idea why it does not work, and it is very weird it is not giving any errors. The problem regarding JavaFX is that it is no longer supported by the newer versions of Java.

  • @kingstonejob7840
    @kingstonejob7840 2 роки тому

    This tutorial has been helpful to me, thanks a lot.

  • @NeatKibbles4
    @NeatKibbles4 3 роки тому +1

    God bless you and thank you! You literally saved me

  • @hatimvillain1560
    @hatimvillain1560 22 дні тому

    please i have afile jar created with java 17 and i want to convert it or make it work with java 1.8 . how ican do it

  • @_k0n4_93
    @_k0n4_93 Рік тому

    Thanks soooooo much!!! It really helped me a lot. Great work :D

  • @QuangPham-bc7lc
    @QuangPham-bc7lc 3 роки тому +1

    when i run the artifacts which I built, the image and txt file can't be loaded. it said "path" (The system cannot find the path specified). but if I run on intelliJ, it completely normal. I dont understand why. Can u explain it for me

    • @Randomcode_0
      @Randomcode_0  3 роки тому +1

      I would assume it is because you access your files using a relative path or the full, path which would be changed when you build you program. You should put text and images inside a resource folder, you then need to access your files through the resource folder, which will stay the same when you build you project.
      I got a video about this topic: ua-cam.com/video/ABXiJkCcevc/v-deo.html

    • @QuangPham-bc7lc
      @QuangPham-bc7lc 3 роки тому

      @@Randomcode_0 i do exactly the same as you but i still get "Cannot invoke "java.net.URL.getPath()" because the return value of "java.lang.Class.getResource(String)" is null". In my resources i have 1 package, i have put my txt file inside it and even outside that package (but still in resource). If i just create a java project then do like you is ok but with javaFX i dont understand why

    • @QuangPham-bc7lc
      @QuangPham-bc7lc 3 роки тому

      @@Randomcode_0 sorry my mistake :))) i dont know why when i use in class which is not main although i have add "Main.class" before getResource it didnt run but in Main file it run perfectly. Anyway tks you very much

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      Glad I could help :)

  • @The242511
    @The242511 3 роки тому +1

    One question, when I make a Main_1 class do I need to add every external libs I use or only JavaFX?

    • @Randomcode_0
      @Randomcode_0  3 роки тому +1

      We do it with JavaFX because it is no longer supported by newer versions of Java, it should not be necessary to add every library, but it depends on the library. I sadly cannot give you a real answer, because it depends, we need to add everything that is not supported by the JDK we use.

    • @The242511
      @The242511 3 роки тому +1

      @@Randomcode_0 Oh yes, I forgot they parted JavaFX from Java in the newer version, ok I'll try the good ol' brute force when the time comes for executable build :D

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      That's the spirit! :D

  • @kcodesubfield5145
    @kcodesubfield5145 3 роки тому +1

    Thanks Sir but i have observed that when u have different package and u build its does not run. When is it appropriate to build jar file when the project is completed or as you are developing or at the initial stage

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      I am not 100% sure when it is "correct" to use jar files. You should think of a jar file kind of like the ZIP file format, which means we use to compress a project into one file which we can then send to other to reduce loss of data.
      Takle a look at the Java Documentation for more information: docs.oracle.com/javase/8/docs/technotes/guides/jar/jarGuide.html

  • @dhananjayat1373
    @dhananjayat1373 3 роки тому

    I create jar using uaing this video.but i converting it into exe using launch4j get error as jni error occured.problem is in my jre.how to fix that.please help dear.

  • @matrixblack9424
    @matrixblack9424 3 роки тому +1

    Thank you it helped me.

  • @Whatsup-fl5ww
    @Whatsup-fl5ww 5 місяців тому

    if i deploy it in vercel will the link i get from it be able to work as it does when i execute in IntelliJ?

  • @Traptrickerplays
    @Traptrickerplays 2 роки тому +2

    Thanks for the video! When I launch the jar nothing happens and when I look at the error message it gives me
    "Error: Could not find or load main class com.traptricker.etherminetrackerjavafx.Main_1
    Caused by: java.lang.ClassNotFoundException: com.traptricker.etherminetrackerjavafx.Main_1".
    Do you know how I fix this?

  • @scabbardgaming9456
    @scabbardgaming9456 3 роки тому

    it doesn't work for me.
    my JDK version is 16 and OpenJFX 17.
    I guess there some bugs to be fixed in my version.
    or i have some configuration errors or it is all about the version I've been used.

  • @achrafmsadek6706
    @achrafmsadek6706 2 роки тому

    Thank you very much after sir after a long time of googling ,this is a brilliant solution .

  • @samuelcommander8611
    @samuelcommander8611 2 роки тому

    This is brilliant, thanks so much! I've tried it out with a simple JavaFX project and can now run it from my terminal, no IDE needed.
    One quick q - if I have a project that reads from / writes to a .txt file how can I include that in the build please?

    • @Randomcode_0
      @Randomcode_0  2 роки тому +1

      I am not sure how it would work if you have a file in your resource folder and then just read and write to it using the resource folder as the destination you need to use in your jar. As far as I understand this should still work in a JAR, but I could be wrong. In larger projects, you would connect your project to a database, which is an entirely different world of its own.

    • @samuelcommander8611
      @samuelcommander8611 2 роки тому

      @@Randomcode_0 ace, thanks for this, I'll give it a go.

  • @ArmoFreekickerz
    @ArmoFreekickerz 3 роки тому +1

    thank you bro, you helped me a lot

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      Thank you! Glad you enjoy my content :)

  • @prabha7976
    @prabha7976 3 роки тому +1

    In bin folder I am unable to copy all the files...can someone help me out plzz

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      Inside my bin folder I click on the first file then hold down shift and press on the last file, and then I just click ok to import the files.

  • @Giannis_Krimitzas
    @Giannis_Krimitzas 2 роки тому

    Hello. Can you possibly do the same with Eclipse instead?

    • @Randomcode_0
      @Randomcode_0  2 роки тому

      I do not have any experience working with Eclipse and therefore does not plan to make any video about it any time soon.

  • @U_Lambda
    @U_Lambda Рік тому

    Any reason why mine would be exporting as a zip?

  • @dublUayaychtee
    @dublUayaychtee 3 роки тому +1

    I am on Linux so when I downloaded the sdk, there was no bin folder. Do I have to download the one for windows and use the dlls from there?

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      I have not been able to find a proper solution to your problem. My best suggestion would be to use something like Maven or Gradle to try building you Jar file.

    • @dublUayaychtee
      @dublUayaychtee 3 роки тому +1

      @@Randomcode_0 downloading the windows dll files worked

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      Nice, good to knwo!

    • @Andrew-yv7zh
      @Andrew-yv7zh 2 роки тому

      Just add the .so files from the bin folder. Most of them start with "lib" but aside from that, the filenames are the same. (You'll be missing some "api-****.dll" files but that's fine, you don't need those on linux)

  • @shanksakagami8780
    @shanksakagami8780 Рік тому

    why i can run the file?
    it says a java exception has occured

  • @michealking6425
    @michealking6425 2 місяці тому

    Got mimes to work, finally ❤

  • @moukhafianass4053
    @moukhafianass4053 3 роки тому +1

    what about javafx application using maven

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      Check this video for my solution using maven: ua-cam.com/video/EyYb0GmtEX4/v-deo.html

  • @AarónMendoza-i9k
    @AarónMendoza-i9k Рік тому

    Y este .jar se puede distribuir multiplataforma?

  • @tweber476
    @tweber476 3 роки тому +1

    I constantly get this Error: A JNI error has occured, please check your installation and try again. Although I can run my program in Intellij normally. Any clues?
    Cheers!

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      I have never had this problem myself, after reading a bit about you error message, it seems to be a problem regarding your java version on your computer.
      Found this page trying to solve the problem: webdeasy.de/en/error-a-jni-error-has-occured-how-to-fix-this-java-error/
      Hope it helped I sadly cannot give any better solution :)

    • @tweber476
      @tweber476 3 роки тому

      @@Randomcode_0 unfortunately didn't work. Thnx for ur help though! :)

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      I am sorry I could not be to much help, I am sure you will figure it out!

    • @simonhutchinson2723
      @simonhutchinson2723 3 роки тому

      Have you managed to fix this error yet? I am getting the same thing

    • @MrNyvle
      @MrNyvle 3 роки тому

      @@simonhutchinson2723 I managed to fix this error, I followed the link above and I was using OpenJ9, once I changed it to the correct javaw.exe I checked that my JRE/JDK and SDK where the same. They weren't my java was 1.8.0 and my SDK was openjdk 15, once i switched my SDK to 1.8 after a rebuild of the project it finaly worked. I hope I wasn't too late to help if it helps at all :)

  • @giusepperusso6971
    @giusepperusso6971 Рік тому

    Beautiful, a real big thanks, sincerely !

    • @Randomcode_0
      @Randomcode_0  Рік тому

      Thank you so much! I'm glad you enjoyed the tutorial.

  • @phylaxcool
    @phylaxcool 3 роки тому +1

    i tried run the jar with "java -jar example.jar" but it says "Error: Could not find or load main class Main_1" how to fix this bro?

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      There are quite a few reasons you could get this error. The simplest solution would be that you have the Main_1 class in the wrong package, it needs to be in src. You could also try removing the underscore from the name because it sometimes is a problem with some operating systems. If this isn’t the case, I do not know why it is not working.

    • @phylaxcool
      @phylaxcool 3 роки тому +1

      @@Randomcode_0 i created and new project and it runs smoothly, my bad sir. I think my project is broken because i changed the jdk. Thankyou very much :D
      EDIT:
      After some research about Could not find or load main class error. In my case, this is because sql server driver 9.2. Tried to remove it and it works or downgrading the sql server driver.

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      Glad you got it working :) And you always learn something when you get it working at the end!

  • @Marc-jn3wn
    @Marc-jn3wn 3 роки тому +1

    Doesn't work on Linux or Mac because of the missing DLL Files. They are only available on Windows

  • @quenyanwarrior8741
    @quenyanwarrior8741 Рік тому

    does it work on mac or linux too? the one that imports the dlls file, in my experience, DLL associates with windows

    • @Randomcode_0
      @Randomcode_0  Рік тому +1

      I have only tested it on windows. I seem to remember some previous comments discussing that it was possible, but I can't guarantee that it works.

    • @quenyanwarrior8741
      @quenyanwarrior8741 Рік тому

      @@Randomcode_0 I tried it, instead of dlls, in mac lib folder i have .jar, .dylib, as well as .properties file, i just put all those to the project and run just fine.

  • @shumai5113
    @shumai5113 3 роки тому +1

    This helps me a lot.

  • @innzelena7180
    @innzelena7180 3 роки тому

    Thank you so much. But I meet the problem [Exception in thread "main" java.lang.StackOverflowError]. How can I solve the problem?

    • @Randomcode_0
      @Randomcode_0  3 роки тому

      A StackOverflowError is a runtime error in java. It is thrown when the amount of memory allocated is exceeded. A common case of a StackOverflowError being thrown, is when call stack exceeds due to excessive, deep or infinite recursion.

    • @innzelena7180
      @innzelena7180 3 роки тому

      Thanks a lot! I've solved my problem. I wrote the wrong code in Main_1.java. I fix the code, and now I run successfully!

  • @mohammadmehdikhajehzadeh1655
    @mohammadmehdikhajehzadeh1655 3 роки тому +1

    when I want to run it i get JNI error. what jre version do you use?

    • @Randomcode_0
      @Randomcode_0  3 роки тому +1

      I am using 15.0.1
      It is a problem where the Java versions in your program does not exist on your computer.
      I had a friend who had the JNI problem as well, he need Java SE Development Kit 15.0.1 downloaded to run the versions build with 15.0.1.
      Where to download Java Development Kits www.oracle.com/java/technologies/javase/jdk15-archive-downloads.html
      I also had someone else having the same problem using this: webdeasy.de/en/error-a-jni-error-has-occured-how-to-fix-this-java-error/

  • @laponiec
    @laponiec Рік тому

    This method worked for me, the other method from your other video didn't

    • @Randomcode_0
      @Randomcode_0  Рік тому

      Good to hear! Some versions of JavaFX just work and some do not. It is a bit weird. I am just glad you got it working.

  • @vojinkrstic9347
    @vojinkrstic9347 2 роки тому

    When i start it with command prompt I get this message: no main manifest attribute, in Restoran.jar
    Even tho I have manifest.mf file:
    Manifest-Version: 1.0
    Main-Class: Main_1
    Do you know what could be the problem?

    • @Randomcode_0
      @Randomcode_0  2 роки тому

      It might be because do not define in which package your main class is located. If you main class was located inside com.mypackage it would look like this: "Main-Class: com.mypackage.MyMainClass"

  • @u_n_d_e_r_s_c_o_r_e_d
    @u_n_d_e_r_s_c_o_r_e_d Рік тому

    can i do it without .dll files? large .jar size

  • @djpharaohoftime3200
    @djpharaohoftime3200 3 роки тому +1

    Thank you you are a life saver.

  • @VikasSharma-fc2wm
    @VikasSharma-fc2wm 2 роки тому

    This really helps me