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👍👍👍
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.
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 ?
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.
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.
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
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.
I have a video that talks all about this error. Start about 3 minutes in to skip the boring part: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-meEnY-7t1bc.html
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.
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.
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.
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.
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!! ru-vid.com/show-UChV1b3e3HgrZmx5cTBx8OEwcommunity?pvf=CAI%253D
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!
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!
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!!
@@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!
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!!
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!
@@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?
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!