I want to put my java Project in a .jar or in an .exe. I can not find a solution for my problem. That is my project structure:
project
1.1. pom.xml 1.2. .idea 1.2.1. libaries 1.2.1.1. many maven dependency files 1.3. .GUI 1.3.1. .idea 1.3.1.1. libaries 1.3.1.1.1. many maven dependency file 1.3.2. src 1.3.2.1. main 1.3.2.1.1. java 1.3.2.1.1.1. .java files 1.3.2.1.2. recources 1.3.2.1.2.1. .fxml files 1.3.2.1.2.2. CSSStylesheets 1.3.2.1.2.2. .css files
I follow instructions on youtube for creating a .jar in Intellij (https://www.youtube.com/watch?v=ZlyTn8PZ3Fc) but the .jar was not executable. It just print this Display parameters as parsed by Maven (in canonical form) and comparison result:
to the console after running java -jar file.jar
. (After the double dot there does not come more information.)
Next I found another youtube video that shows me it does not work like in the first video because of the maven dependencies (https://www.youtube.com/watch?v=HGHu-SzL-5E). In this video I do not know what to do in 5:39. He copies something but I do not know from where that is. I tried to put the same files in there like he did but it does not work. There comes a ClassNotFoundError that it can not be found the .fxml files. Then I do not write them in the command but all other .java files but it was the same error.
On this (https://introcs.cs.princeton.edu/java/85application/jar/jar.html) site I had my next try. I follow the instructions like this: I dreated a .mf file and put all .fxml and .java and .class files in the command but it can not be found the .class files so I put them out of the command. And then ist comes a ClassNotFoundError. It can not find the Main class. Intellij mark it in the .mf file red as well and I do not know why.
Then I follow the instructions of this (https://cwiki.apache.org/confluence/display/MAVEN/Tutorial%3A+Build+a+JAR+file+with+Maven+in+5+minutes) site but there an empty .jar file was created.
Now I do not know what I did wrong or what I miss so I hope someone can help me.