Maven and Java 21
I have a project that I’m working on soon, that’s going to be a Java Spring Boot application, I know you wouldn’t think that I’m a Java developer looking at most of my repositories. I’ve not actually set up Maven and Java on this machine yet so I thought I’d document it while I go along. It’s worth noting that I’m not using the version of maven within the distribution repositories as it’s a little outdated, and I’m going to be using an Oracle JDK which is how this set up differs from standard.
First I’m going to need a Java JDK, I’ve choosen to use an Oracle JDK and Java 21. It’s simple to get, just use wget to download the file, then install the .deb.
|
|
Now that Java is installed and the version displayed is correct I can move on to installing Maven, which is basically the same method, not using apt get but getting the binaries and installing them.
|
|
This will set up maven on the system, however it’s not on the path next I’ll append the following lines my bash profile.
|
|
Then reload the profile.
|
|
Now to test that everything is working as expected we should have maven display it’s version with the correct JDK.
|
|
Maven and Java 21 are now configured on my system and I can now start my Java Spring Boot project. 👍