Use IntelliJ IDEA to create an EXECUTABLE JAR With Dependencies Using Maven

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 67

  • @user-kj3is6li2n
    @user-kj3is6li2n 2 года назад +9

    This is the perfect tutorial everything i needed is included good mic quality easy to understand and follow Thanks

    • @beginsecure
      @beginsecure  2 года назад

      Glad it helped! Thanks for watching!

  • @actaeon5770
    @actaeon5770 8 месяцев назад +2

    Best shifu ever. Teaches with common exceptions and shows how he did with his way around, no one does that

    • @beginsecure
      @beginsecure  8 месяцев назад

      Thanks for feedback, really appreciate it!! All the best!!

  • @ulugbektoshmatov3433
    @ulugbektoshmatov3433 Год назад +1

    Thank you very, very, very much bro! You clarified what was obscure for me for days. I have completed the "maven part" of a project so easily based on your explanation, just super👍👍👍

    • @beginsecure
      @beginsecure  Год назад +1

      Excellent! Glad it helped. Take care!!

  • @miggiegarcia6213
    @miggiegarcia6213 Год назад +4

    Overall a great video, easy to understand, no weird music and audio is good and steps outlined that were easy to follow. I also love that you explained the errors so that eliminated some rabbit-holing research for me.

    • @beginsecure
      @beginsecure  Год назад

      Glad it helped, thanks for watching!!

  • @mrprjudit
    @mrprjudit 11 месяцев назад +1

    Useful tutorial. Really helped me resolve an issue, I was googling for hours...👍

    • @beginsecure
      @beginsecure  11 месяцев назад

      Glad it helped!! Happy New Year!!

  • @TaylorMosqueraCastro
    @TaylorMosqueraCastro 9 месяцев назад

    Busque mucho saber esto y por fin encuentro algo que sirve realmente, felicitaciones, muy buen video

    • @beginsecure
      @beginsecure  9 месяцев назад

      Muchísimas gracias, estoy contento de que te haya sido de ayuda. Tengo planes de crear una versión en español de mi canal con el mejor contenido seleccionado. Espero lanzarla en las próximas semanas.

  • @nitw_pranayreddyannam7867
    @nitw_pranayreddyannam7867 6 месяцев назад +1

    Very good video, Got a clear idea about the creation of a jar file and its execution

    • @beginsecure
      @beginsecure  5 месяцев назад

      Glad it helped! Thanks for watching!

  • @MaxXPlagiarism
    @MaxXPlagiarism Год назад +2

    I wish i could like it twice especially for the bonus

    • @beginsecure
      @beginsecure  Год назад

      Hahah..me too. Thanks, love that!!

  • @kh0lis
    @kh0lis 8 месяцев назад +1

    Superb tutorial. Thanks 👍

    • @beginsecure
      @beginsecure  8 месяцев назад

      Glad you liked it! Thanks for watching!

  • @Itskaintmeenu
    @Itskaintmeenu 2 года назад

    hello nice sharing

  • @krystiansereda539
    @krystiansereda539 2 года назад +1

    Wow, impressive video, great job!

    • @beginsecure
      @beginsecure  2 года назад

      Thanks so much for your kind words, and thanks for watching!!

  • @tej_3423
    @tej_3423 Год назад

    Simply Perfect.

  • @ylmazmehmeth
    @ylmazmehmeth 2 года назад +2

    easy to understand, thanks 🤙

    • @beginsecure
      @beginsecure  2 года назад

      Glad it helped! Thanks for watching!

  • @senya1696
    @senya1696 Год назад +1

    Thank you! You helped me a lot!

    • @beginsecure
      @beginsecure  Год назад +1

      Great to hear that it helped!! Take care!!

  • @petarbutrakov315
    @petarbutrakov315 Год назад +1

    Hi, I've recently started using Maven on an existing InteliJ project. I've always used the Build artifact function to build ther jar file and wrap it into exe file. Now, with the new maven version of the project the artifact is not created when I choose Build. I've checked the steps countless times and it does not work. Can you help? I'm happy to provide any aditional info, if that helps.

    • @beginsecure
      @beginsecure  Год назад

      Hi @petarbutrakov315 The response for this is a bit more than a usual reply. I added a post here that walks you through some steps I hope will help. Let me know. Thanks for watching!! ruclips.net/channel/UChV1b3e3HgrZmx5cTBx8OEwcommunity?pvf=CAI%253D

  • @wilmercuevas6491
    @wilmercuevas6491 6 месяцев назад +1

    what about when I have resources like text files and images? it doesnt appear when I run my jar file

    • @beginsecure
      @beginsecure  5 месяцев назад

      You need to ensure that your resources, such as text files and images, are included in the JAR file and correctly referenced within your code. Maven uses the resources section in the pom.xml file to specify the location of these resources. Additionally, you'll need to access these resources using the appropriate method in your Java code. A good topic for a video I think.

  • @mondoshigua
    @mondoshigua Год назад +1

    👋🏼🇨🇴🧔🏻👍🏼🤝🏼 Saludos desde Colombia.

  • @Yubilsal
    @Yubilsal Год назад

    Hello, i tried this tutorial. But when i tried to run the jar named MyFirstApp-1.0-SNAPSHOT.jar at the target folder still gives the no main manifest error. Is there a way to run this without adding Manifest parameter ?

    • @beginsecure
      @beginsecure  Год назад

      I'm sorry to hear you're encountering this issue. The 'no main manifest attribute' error usually indicates that the main class wasn't specified in the JAR's manifest. You could double-check your Maven pom.xml configuration or IntelliJ's Artifact settings to ensure the main class is correctly set. If you've followed all the steps in the video, a clean rebuild might also help. Let me know if you continue to face this issue, and I'll do my best to assist you further.

  • @Dario-v9x
    @Dario-v9x Год назад

    how did you get Dependencies tab, the one after Build? I am running latest IntelliJ with Maven plugins (all 3 of them)

    • @beginsecure
      @beginsecure  Год назад

      If I understand, you are talking about around the 6:16 minute mark in the video? Maven should download the dependencies and show them there. If they are not, it could be because Maven hasn't pulled the files from central yet. Look for the Maven symbol with a 'recycle' arrow and click that to initiate the download, or run mvn build from the command line maybe to get the dependencies. I have a Discord channel linked on my channel if you want to talk in more detail. Good luck and thanks for watching!

  • @rohitchanda8461
    @rohitchanda8461 Год назад

    Amazing video ❤
    How to add JavaFX dependencies though? I created a project built through Maven, and implemented JavaFX functionalities through Scenebuilder. The app runs fine through IntelliJ, however the JAR file doesn’t run. It says “could not run the file because of missing JavaFX properties “. Looking forward to hearing from you.

    • @beginsecure
      @beginsecure  Год назад +1

      Hi Rohit, thanks for watching the video. Since Java 11, JavaFX has been modularized and is not part of the standard Java libraries, so you need to include it yourself. I count 8 modules here: mvnrepository.com/artifact/org.openjfx Not sure which ones you will need, I'd start with a few like Base, Controls and graphics maybe and see what happens. To add them to your project in the dependencies section of your poml.xml file, you'll add something like this:

      org.openjfx
      javafx-controls
      20

      org.openjfx
      javafx-fxml
      20

      org.openjfx
      javafx-base
      20

      I suggest version 20 to start with. It looks like the latest stable release. Take care and good luck!!
      -Brian

  • @dominikbreksa343
    @dominikbreksa343 2 года назад +1

    Thank you :)

    • @beginsecure
      @beginsecure  2 года назад

      You're welcome! Thanks for watching!!

  • @harshitasarathe9554
    @harshitasarathe9554 Год назад

    I added assembly plugin but its not reflected in MAVEN tab of IntellIJ

    • @beginsecure
      @beginsecure  11 месяцев назад

      Try refreshing or reloading the project so Maven will download what it needs.

  • @dawidus443
    @dawidus443 7 месяцев назад +1

    luv u!

    • @beginsecure
      @beginsecure  7 месяцев назад

      Thanks, glad the video helped!

  • @Hmada_BJ
    @Hmada_BJ Год назад

    JavaFX runtime components are missing, and are required to run this application
    This error took the sleep from my eyes.

    • @beginsecure
      @beginsecure  Год назад

      See if this recent JavaFX video helps you: ruclips.net/video/UOFmZxdte2g/видео.html

  • @rafaeljacovmedel8953
    @rafaeljacovmedel8953 Год назад

    I've created a new hello world app but the build artifact doesn't create a jar file. can you help?

    • @beginsecure
      @beginsecure  Год назад

      Hello, sure. Here are some things to try: 1) check to see that the packaging element in your pom.xml is set to jar 2) Did you run mvn package or install which usually create a jar, 3) did you get an error message and if so what is it 4) check the target directory to see if the jar was created. Let me know if anything worked.

  • @brunosalatalima1182
    @brunosalatalima1182 Год назад

    Hey, Brian! Thanks for this video. I'm working on a JavaFX project, with dependencies and I have to add the "--module VM options" to Run. It's working fine and I've created the JAR file. The problem is to Run my jar file.. I had to create a .bat file with modules path and the VM options. So I'm just able to Run my JAR file executing the .bat file.. I've been trying to add the VM options in differentes Maven Pluging in pom.xml file, but It's not working.
    Do you have any idea about it?
    SDK 17
    Thanks anyway!

    • @beginsecure
      @beginsecure  Год назад +1

      Hey Bruno! First of all, thanks for watching the video!
      There are a couple of solutions you might want to try. Let me start with the best one for your situation. Since you're using SDK 17, consider using jpackage, a tool introduced in Java 14 for packaging self-contained Java applications. jpackage can create native installers and executables for your application, including all necessary dependencies and VM options. This tool is part of the JDK and is specifically designed for packaging applications like JavaFX. I don't have a video on this, but it seems like a great topic for one!
      Give it a try and let me know if it works for you. Take care!!

    • @brunosalatalima1182
      @brunosalatalima1182 Год назад

      @@beginsecure Thanks so much for answer so fast. I'll try it tomorrow and bring new to you. But I think a tutorial doing this would be helpfull for JavaFX community, because I really try to find, but without success and it seems to be frequent.
      Thanks again and I'll be back soon! Take care!

    • @brunosalatalima1182
      @brunosalatalima1182 Год назад

      Hi Brian!
      I tried all day to apply jpackage, but it still requires .bat or run by terminal. I'll send you more informations on Discord!

  • @Jack-t6n
    @Jack-t6n 9 месяцев назад

    Error: Could not find or load main class com.beginsecure.App
    Caused by: java.lang.ClassNotFoundException: com.beginsecure.App
    i am facing this error

    • @matheusdesouza565
      @matheusdesouza565 9 месяцев назад

      Also getting this, while trying to compile it using maven

    • @beginsecure
      @beginsecure  9 месяцев назад

      The error you're encountering, Could not find or load main class com.beginsecure.App followed by java.lang.ClassNotFoundException: com.beginsecure.App, suggests that the Java runtime is unable to locate the specified class. Double-check the spelling and casing of your package and class names in both your Java file and any place you reference it. Java is case-sensitive, making this a common pitfall.

    • @beginsecure
      @beginsecure  9 месяцев назад

      I have a video that talks all about this error. Start about 3 minutes in to skip the boring part: ruclips.net/video/meEnY-7t1bc/видео.html

  • @ihorvolkov5600
    @ihorvolkov5600 Год назад

    Will this include source code (.java files), and if not how can I include them?
    Thank you.

    • @beginsecure
      @beginsecure  Год назад

      Thanks for reaching out. I have a GitHub account set up for posting files, but I need to be more diligent in keeping up with each video. I'll post the content for this video and a few others this weekend and add a link in the video descriptions. I'll post the link here as a reply too. Happy Holidays!!

    • @beginsecure
      @beginsecure  Год назад

      I just added the repo here:
      github.com/BeginSecure/IntelliJExecutableJar.git
      Happy New Year!!

  • @miggiegarcia6213
    @miggiegarcia6213 Год назад +1

    @ 13:02 my out folder is not orange, is this a problem?

    • @beginsecure
      @beginsecure  Год назад +1

      Hmmm...interesting question, it might be a project set up issue. Orange is the color for excluded folders. IntelliJ excludes indirect dependencies automatically as you shouldn't be importing those. Also, having the indirect dependencies excluded also speeds up the search. If the code builds and you are able to run the code you should be fine. Thanks for watching!

    • @miggiegarcia6213
      @miggiegarcia6213 Год назад

      @@beginsecure i was still able to build the jar successfully and did a release using github for my text adventure game. can you tell me more about "might be a project set up issue"? what do you mean by that?

    • @beginsecure
      @beginsecure  Год назад +1

      Just a thought, since the folder was orange, maybe it was not an excluded folder. Shouldn't be a problem and it sounds like you have it working fine. Congrats!

  • @FAZALRAHMAN-xn9tw
    @FAZALRAHMAN-xn9tw Год назад

    hi,
    need help, can you ?

    • @beginsecure
      @beginsecure  Год назад

      Post your question and let's see.