09/15/2025
Recently I had to buy a new laptop due to Windows 10 becoming absolute in October. Of course, with every new laptop it’s a blank canvas for setting everything up again. I had to download all the software I use and will need for all my courses.
For this class I need to have JDK, Maven and Gradle. I ended up downloading apache-maven 3.8.9 version since it is the stable version. I also made sure I had the most up to date Java.
I did encounter some issues with my setup all related to Path environment. I had to make sure MAVEN_HOME and JAVA_HOME was linked with the downloaded version and not referencing an older version. This was such a frustrating process but also a great learning experience.
To make sure I had my setup correct I checked my terminal typing “mvn -v” and of course, I had another issue with warning:
“
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
“
To fix this I did a lot of googling and came up with this:
Set the Variable
Open your System Environment Variables and add:
• Variable name: JAVA_TOOL_OPTIONS
• Variable value: --enable-native-access=ALL-UNNAMED
This tells Java to apply that flag to every JVM process, including Maven.-
Restart Your Terminal and run cmd:
echo %JAVA_HOME%
where java
java -version
mvn -v
My setup looks good and then I tested the Maven build with a test-project.
(This prompt will generate a simple Java project in a folder called test-project.)
Cmd:
mvn archetype:generate -DgroupId=com.example.test -DartifactId=test-project -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
Access the project
cd test-project
Build the project
mvn clean install
Of course I had another issue:
Maven archetype mismatch with modern JDKs. The default quickstart template I used is trying to compile with Java 5 (source and target set to 5), which is ancient history in Java terms. Java 24 doesn’t support anything below Java 8, hence the compilation failure.
I had to fix the compiler settings in test-project/pom.xml by adding this block:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Then in cmd:
cd test-project
mvn validate*BUILD SUCESSFUL *
Helpful resources: https://maven.apache.org/install.html
Top comments (0)