How To Build - AttiliaTheHun/Songbook-Manager GitHub Wiki
To build the project, you need to be able to work with the following tools:
- Git the version control system to download the source code.
- IntelliJ IDEA the IDE to easily navigate through the source and hopefuly build with a single click
- Maven the build system to actually build the project
Now you can download the source code as a .zip
to avoid using Git and you can use any other IDE to avoid using IntelliJ. I do not see an easy way to get around without Maven though.
If you decide to use git, the following command will download the source code for you:
git clone https://github.com/AttiliaTheHun/Songbook-Manager.git
You should then be able to open this folder as a project in IntelliJ IDEA.
To simply run the program, the green button should suffice. If you want to build a Windows executable, you need to run few more tasks.
You need to persuade Maven to do the following for you:
- Compile the source code and put it inside an executable
.jar
file - Build
jar
with dependecies that contains the compiled code along with resources and manifest - Run Launch4J to wrap this
jar
into anexe
On the right in the IDE you can open a Maven option menu. You want to chose either Lifecycle > package
(better) or Plugins > assembly
, and then Plugin > launch4j
.
It may not work at first and you may need to do some debugging or try multiple times. Make sure the plugin you are running is enabled. In the pom.xml
file, a plugin can be disabled by the following line
<skip>true</skip>
so make sure you comment it out
Other issue is that the launch4j plugin can not find the jar
file with dependecies, so make sure the names in the plugins match.
A good idea is to disable the tests, because they are shit and ruin the build, I wrote them myself. To disable tests, in the pom.xml
file, the Maven Surefire plugin needs this configuration:
<configuration>
<skipTests>true</skipTests>
</configuration>
JavaFX complains about Unsupported configuration and unnamed modules and other stuff in red font. That is alright, we want that. However it may happen that JavaFX runtime components are missing or something other. The problem usually is that the runtime can not find the JavaFX libraries.
This can be fixed by adding the following CLI argument to the run configuration:
--add-modules=javafx.base,javafx.controls,javafx.graphics,javafx.web,javafx.swt
If you did not install JavaFX and for some reasong Maven can not do it for you, you need to download it from the official site and ideally put it to the same location as is your JRE. Keep in mind that your JRE has to be of the same or newer version as the JavaFX libraries you downloaded and that you might need to download a non-Oracle JRE, such as this.
I realise that this sucks and takes the position right after being stabbed and robbed on your list of the worst things that might ever happen to you, but hey, listen up. It is only going to be worse. The next project you encounter might be in JavaScript. You chose to be a developer yourself, there is noone else to blame. You could have simply downloaded the prebuilt executable from releases like anybody else, but you had to prove yourself that you are not like everyone else. Well then, suck it up now :)
If you think you are doing real bad, just think about how many guys around the world are trying to set up a Python virtual environment this very moment...
If you struggle with the build, feel free to contact me on Discord (id 617468
) or open an Issue, because that is definitely what they are here for 😉.