Building jExiftoolGUI is not really straightforward. The combination of gradle and IntellIJ is not a 100% easy "one-click-does-it-all" excercise. I did not find a nice "one-click-does-it-all" method of building jExifToolGUI yet. Building artifacts is also a hit and miss excercise: Sometimes it works and creates a correct jar and sometimes it doesn't. If some java/gradle/IntellIJ expert has info, please let me know.
-
Download the source code. Either as zip or via "git clone .."
-
Start IntellIJ via "idea &" or via the menu.
-
Import the project. Select "Import project from another model" (2nd radiobutton) and select "Gradle" as option.
-
Go to (menu) File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle. Make sure IntelliJ is selected as "Build and run using" and "Run tests using". This is necessary to compile the gui forms into the java code.
-
Go to (menu) File -> Settings -> Editor -> GUI Designer and set Generate GUI into: Java source code (This is a vital step! See also the readme-intellij)
-
Select (menu) Build -> Build Project
-
Now open a terminal (command prompt) and "cd" into your project folder.
- On linux/MacOS use :
./gradlew assemble buildDependents shadowJar shadowDistZip
- On Windows use:
gradlew.bat assemble buildDependents shadowJar shadowDistZip
- On linux/MacOS use :
When done check the build folder.
/build/libs
will containjExifToolGUI-all.jar
andjExifToolGUI.jar
. The big "-all-jar" is the jar file that contains all dependency jars inside as well. This is the "one in all" jar. thejExifToolGUI.jar
can't be started by itself. You have to provede the depenedency jars via aclasspath
statement.build/distributions
will contain 2 zip files and 2 tar files (fot the user's preference). ThejExifToolGUI.tar (.zip)
will contain the "small"jExifToolGUI.jar
bundled with all dependency jars in alib
folder. ThejExifToolGUI-shadow.tar (.zip)
contains the "big"jExifToolGUI-all.jar
with all dependency jars inside it.
I always use the build\libs\jExifToolGUI-all.jar
but rename it as jExifToolGUI.jar
.
Every time you modify the Gui (one of the forms), or even a label text as part of the gui (form), you need to build first in IntelliJ. Sometimes it is best to do a "build -> Rebuild Project".
Then you go into the terminal/command prompt again and do the "./gradlew assemble buildDependents shadowJar shadowDistZip" again.
And again: Take the build\libs\jExifToolGUI-all.jar
(and rename it as jExifToolGUI.jar
).
Sometimes "something" doesn't work anymore, or you get "strange" error messages. The project sometimes get "corrupt" (due to some bugs in IntellIJ?)
- Remove the
build
folder completely and do in IntellIJ a "Build -> Rebuild Project", followed by the./gradlew assemble buildDependents shadowJar shadowDistZip
. In 99% of the cases, everything will be OK again.