3.0 KiB
3.0 KiB
| sidebar_position | title |
|---|---|
| 2 | Java and Maven |
Java and Maven
Step 1 — Install Java SE Development Kit (JDK) 8
- Download JDK 8 from:
- Gitea release assets
- Oracle's official archive if you have an account
- Run the installer and complete the installation. Note the installation path (e.g.,
C:\Program Files\Java\jdk1.8.0_xxx). - Set the
JAVA_HOMEenvironment variable:- Open Start → Search → "Edit the system environment variables"
- Click Environment Variables
- Under System variables, click New:
- Variable name:
JAVA_HOME - Variable value:
C:\Program Files\Java\jdk1.8.0_xxx(your actual JDK path)
- Variable name:
- Find the
Pathvariable under System variables → click Edit → New, and add:%JAVA_HOME%\bin - Click OK on all dialogs.
- Open a new terminal window and verify:
java -version
javac -version
Both must return 1.8.x. If javac is not found, JAVA_HOME or PATH was not set correctly.
Step 2 — Install Apache Maven
- Download Maven from: (Download the binary zip archive)
- Extract it to a stable path with no spaces (e.g.,
C:\dev\maven). - Set environment variables:
- Create a new system variable:
- Variable name:
MAVEN_HOME - Variable value:
C:\dev\maven(your extraction path)
- Variable name:
- Add
%MAVEN_HOME%\binto thePathsystem variable (same way as Step 1).
- Create a new system variable:
- Open a new terminal and verify:
mvn -version
It should display the Maven version and confirm it is using your JDK 8.
Step 3 — Configure Maven for the Private Gitea Registry
The TrizStock project has several legacy dependencies that are not available on Maven Central. They are hosted on the team's private Maven registry in Gitea. Without this configuration, your build will fail to resolve those dependencies.
- Navigate to the Maven user settings file. If it does not exist, create it:
C:\Users\YOUR_WINDOWS_USERNAME\.m2\settings.xml
- Download the
settings.xml.templatefrom the team resources repository. - Copy the template content into your
settings.xmland replace the placeholders with your actual Gitea credentials:
<settings>
<servers>
<server>
<id>gitea</id>
<username>othmane</username>
<password>54465f0ce0fec1a357eb7d9f7055e3df873db114</password>
</server>
</servers>
</settings>
Verify the registry is accessible by running the following in a terminal (once you have the project cloned — see Step 7):
mvn dependency:resolve
All dependencies, including the legacy ones, should resolve without errors.